Repository navigation
feat: Expose exceptions on evaluation reasons - #290
Merged
keelerm84 merged 4 commits intoNov 9, 2026
Merged
Conversation
Retain the original Throwable in evaluator and client failures, including unrecoverable HTTP 401/403 responses, without changing reason JSON or fallback behavior.
keelerm84
approved these changes
Nov 9, 2026
Member
|
Thank you @hidingmyname for getting this PR put up. I appreciate your contribution, and you should receive a notice once the release has gone out. |
kinyoklion
pushed a commit
that referenced
this pull request
Nov 9, 2026
🤖 I have created a release *beep* *boop* --- ## [6.12.0](6.11.0...6.12.0) (2026-11-09) ### Features * Expose exceptions on evaluation reasons ([#290](#290)) ([e36a6fd](e36a6fd)) ### Bug Fixes * Fix loose key and value comparisons and big segment rule fall-through ([#286](#286)) ([4eb7394](4eb7394)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Release 6.12.0** bumps the package from **6.11.0** to **6.12.0** in `.release-please-manifest.json`, `LDClient::VERSION`, and the docs build action title, and adds the **6.12.0** section to `CHANGELOG.md`. > > That release notes two behavior changes already on `main`: **evaluation reasons can surface the underlying `Throwable`** via `EvaluationReason::getException()` (documented on `variationDetail()`), and **stricter key/value matching plus a big-segment rule fall-through fix** for flag evaluation. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0a42312. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Related issues
Fixes #284.
Describe the solution you've provided
EvaluationReason::exception(\Throwable)andgetException(): ?\Throwable, retaining the original object forEXCEPTIONreasons. Existing reason factories remain unchanged.withBigSegmentsEvaluationStatus()without adding it to the reason's JSON representation or analytics events.UnrecoverableHTTPStatusExceptioncatch for HTTP 401/403. Existing fallback values and the client's offline transition are preserved.Error, both HTTP status codes, serialization privacy, and the post-authentication-error offline state.src-only analysis cannot see SDK consumers.Describe alternatives you've considered
Leaving the cause only in the PSR-3 logs does not let the caller associate the original exception with its failed
variationDetail()call. A separateexception()factory also keeps exceptions out of unrelated error kinds.Validation
PHP 8.4.27 / PHPUnit 9.6.38:
getException()returnednull.UnrecoverableHTTPStatusException, keep reason JSON unchanged, and switch subsequent evaluations offline; the server observed exactly one request per client.UnusedClassforNullEventProcessor, also reproduced on unmodified upstream6df19b5with the same dependency set. I have not suppressed or changed that unrelated issue.Only PHP 8.4 was exercised locally; the existing CI matrix covers the other supported PHP versions and platforms.
Additional context
AI disclosure: this contribution was implemented and submitted by the omp AI coding assistant in the omp harness on behalf of @hidingmyname, at their request. No review reminder or reviewer assignment is requested.
Note
Overview
Failed flag evaluations can now surface the original
Throwableon the evaluation reason, without changing analytics JSON or serialized payloads.EvaluationReasongainsexception(\Throwable)andgetException(): ?\Throwable. The cause is kept forERROR/EXCEPTIONreasons (including throughwithBigSegmentsEvaluationStatus()), but is omitted fromjsonSerialize(),__sleep()/unserialize(), and reason strings—error(EXCEPTION_ERROR)still leavesgetException()null.EvaluatorandLDClient(variationDetailpaths, includingUnrecoverableHTTPStatusExceptionon 401/403) now build reasons withEvaluationReason::exception($e)instead of a bareEXCEPTIONerror kind, while existing default-value fallbacks and the client’s offline transition after auth errors stay the same.Tests cover serialization privacy, prerequisite lookup failures, and several exception types on the client.
Reviewed by Cursor Bugbot for commit e814356. Bugbot is set up for automated code reviews on this repo. Configure here.