Skip to content

fix: Include an error code in provider error events - #68

Merged
kinyoklion merged 1 commit into
mainfrom
devin/1790779287-error-event-code
Oct 28, 2026
Merged

kinyoklion merged 1 commit into
mainfrom
devin/1790779287-error-event-code

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

OFP requirement 5.1.5 (sdk-specs OFP-openfeature-provider-behavior): PROVIDER_ERROR events SHOULD populate the event details' error code.

Describe the solution you've provided

When the LaunchDarkly data source transitions to OFF, the emitted PROVIDER_ERROR event details now include ErrorCode.GENERAL alongside the existing message:

emitProviderError(ProviderEventDetails.builder().message(message).errorCode(ErrorCode.GENERAL).build());

Added LifeCycleTest.itIncludesAnErrorCodeInErrorEvents.

Describe alternatives you've considered

A more specific code (e.g. PROVIDER_FATAL for 401/403) was not used; OFP does not define a mapping, and the Python provider already uses GENERAL for the same transition. Choosing per-error codes would be a cross-SDK decision.

Additional context

OpenFeature Java SDK 1.23.0 fixed propagation of errorCode from provider event details to handler EventDetails, so handlers now observe this value.

Link to Devin session: https://app.devin.ai/sessions/929f5530882d40bc95e55391e97536d5
Open in Devin Desktop: https://app.devin.ai/desktop/session/929f5530882d40bc95e55391e97536d5?variant=devin
Requested by: @kinyoklion

SDK-3254


Note

Overview
Aligns PROVIDER_ERROR event details with OpenFeature provider behavior (OFP 5.1.5) by setting ErrorCode.GENERAL when the LaunchDarkly data source enters OFF and the provider moves to error state. Error messages are unchanged; handlers can now read detail.getErrorCode() (supported after OpenFeature Java SDK 1.23.0).

Adds LifeCycleTest.itIncludesAnErrorCodeInErrorEvents to assert the error code on PROVIDER_ERROR using the existing delayed failing data source setup.

Reviewed by Cursor Bugbot for commit dd3f67a. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@kinyoklion
kinyoklion marked this pull request as ready for review October 28, 2026 18:10
@kinyoklion
kinyoklion requested a review from a team as a code owner October 28, 2026 18:10
@kinyoklion
kinyoklion merged commit bcf5a39 into main Oct 28, 2026
11 checks passed
@kinyoklion
kinyoklion deleted the devin/1790779287-error-event-code branch October 28, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants