Skip to content

fix: provider exceptions crash the caller#97

Open
NeaguGeorgiana23 wants to merge 5 commits into
mainfrom
fix_provider_exeptions
Open

fix: provider exceptions crash the caller#97
NeaguGeorgiana23 wants to merge 5 commits into
mainfrom
fix_provider_exeptions

Conversation

@NeaguGeorgiana23
Copy link
Copy Markdown
Contributor

This PR

Resolves the issue where feature provider errors could propagate and crash the caller during flag evaluation.

To satisfy Requirement 1.4.10 while strictly adhering to the Google C++ Style Guide's zero-exception rules, this PR refactors the evaluation boundary to use compile-time contractual safety:

  • Updates the FeatureProvider evaluation interface to return absl::StatusOr.
  • Updates the client evaluation logic to gracefully handle failure statuses. If a provider returns an error status, the SDK safely intercepts it and returns the default value populated with a general error code.
  • Prevents abnormal termination

Related Issues

Fixes #69

Follow-up Tasks

  • Address remaining minor bugs from the Specification Compliance tracking issue.

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the FeatureProvider interface and its implementations, including InMemoryProvider and NoopProvider, to return absl::StatusOr<std::unique_ptr<...>> for all flag evaluation methods. This change standardizes error reporting and explicitly discourages the use of C++ exceptions. Corresponding updates were made to the ClientAPI, test suites, and mocks to handle the new return types. Feedback suggests adding a null check for the unique_ptr within the absl::StatusOr in openfeature/client_api.h to prevent potential crashes if a provider returns an OK status with a null pointer.

Comment thread openfeature/client_api.h Outdated
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@NeaguGeorgiana23 NeaguGeorgiana23 marked this pull request as ready for review May 12, 2026 08:02
@NeaguGeorgiana23 NeaguGeorgiana23 requested review from a team as code owners May 12, 2026 08:02
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.

Specification Compliance Review

2 participants