Skip to content

chore: aligns the provider’s reason mapping with OpenFeature#19

Open
duyhungtnn wants to merge 1 commit intomainfrom
fix/update-error-reason
Open

chore: aligns the provider’s reason mapping with OpenFeature#19
duyhungtnn wants to merge 1 commit intomainfrom
fix/update-error-reason

Conversation

@duyhungtnn
Copy link
Collaborator

@duyhungtnn duyhungtnn commented Mar 5, 2026

This PR aligns the provider’s reason mapping with OpenFeature by converting several Bucketeer error evaluation reasons into OpenFeature’s generic ErrorReason

… generic ErrorReason and update tests to reflect this change.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the provider’s reason mapping with OpenFeature by converting several Bucketeer error evaluation reasons into OpenFeature’s generic ErrorReason, and updates unit tests to match.

Changes:

  • Update convertReason to map ErrorFlagNotFound, ErrorWrongType, and ErrorUserIDNotSpecified to openfeature.ErrorReason.
  • Update evaluation and conversion tests to expect openfeature.ErrorReason for those Bucketeer error reasons.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/provider.go Extends convertReason’s error-reason mapping to return openfeature.ErrorReason for additional Bucketeer error reasons.
pkg/provider_test.go Updates expectations in evaluation and convertReason tests to reflect the new ErrorReason mapping.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@duyhungtnn duyhungtnn changed the title fix: map specific Bucketeer evaluation error reasons to OpenFeature's… chore: aligns the provider’s reason mapping with OpenFeature Mar 6, 2026
@duyhungtnn duyhungtnn marked this pull request as ready for review March 6, 2026 02:34
@duyhungtnn
Copy link
Collaborator Author

@nnnkkk7
I found it seems we missed some error reason when converting to OpenFeature error reason.
So here is the fix.

Please help me to take a look

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