Skip to content

fix: Better error reporting for structure evaluations #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fabriziodemaria
Copy link
Member

@fabriziodemaria fabriziodemaria commented Feb 20, 2025

Returning parseError in case of unsupported resolving of Value "structure" from the OpenFeature Provider. Same for ConfidenceValue "structure".

The related error message is also clearer now:

Flag path must contain path to the field for non-object values

Related to #190

@@ -206,7 +216,7 @@ extension FlagResolution {

private func getValue(path: [String], value: ConfidenceValue) throws -> ConfidenceValue {
if path.isEmpty {
guard value.asStructure() != nil else {
guard value.asStructure() == nil else {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a bug

@fabriziodemaria fabriziodemaria changed the title [OF] Better error reporting in some cases fix: [OF] Better error reporting in some cases Feb 20, 2025
vahidlazio
vahidlazio previously approved these changes Feb 20, 2025
@fabriziodemaria fabriziodemaria marked this pull request as ready for review February 20, 2025 17:12
@fabriziodemaria fabriziodemaria changed the title fix: [OF] Better error reporting in some cases fix: Better error reporting for structure evaluations Feb 20, 2025
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