Skip to content

Conversation

toddbaert
Copy link
Member

@toddbaert toddbaert commented Feb 7, 2024

As per 1.1.2.4, the blocking provider setter must throw if init fails, so that application integrators can easily understand if their provider is working without attaching event handlers.

We implemented the wait functionality of this method, but we swallow the exception.

This PR fixes that.

@toddbaert toddbaert requested a review from a team as a code owner February 7, 2024 20:02
this::emitReady,
this::detachEventProvider,
this::emitError,
this::emitErrorAndThrow,
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 is the main change - I pass a new delegate which not only emits the events, but throws.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d5a0620) 94.87% compared to head (78aec5b) 95.13%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #794      +/-   ##
============================================
+ Coverage     94.87%   95.13%   +0.26%     
- Complexity      366      368       +2     
============================================
  Files            34       34              
  Lines           858      863       +5     
  Branches         53       53              
============================================
+ Hits            814      821       +7     
+ Misses           23       22       -1     
+ Partials         21       20       -1     
Flag Coverage Δ
unittests 95.13% <100.00%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
ProviderEventDetails.builder().message(exception.getMessage()).build());
}

private void emitErrorAndThrow(FeatureProvider provider, OpenFeatureError exception) throws OpenFeatureError {
Copy link
Member Author

@toddbaert toddbaert Feb 7, 2024

Choose a reason for hiding this comment

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

New delegate which emits errors but also throws.

Copy link

sonarqubecloud bot commented Feb 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

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.

4 participants