FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: add try-catch example for setProviderAndWait usage by abhayguptas · Pull Request #1433 · open-feature/java-sdk · GitHub

docs: add try-catch example for setProviderAndWait usage - #1433

Merged
aepfli merged 2 commits into
open-feature:mainfrom
abhayguptas:fixes-docs
Apr 28, 2025
Merged

docs: add try-catch example for setProviderAndWait usage#1433
aepfli merged 2 commits into
open-feature:mainfrom
abhayguptas:fixes-docs

Conversation

abhayguptas commented Apr 27, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Fixes #1424

This PR improves the README examples by wrapping the setProviderAndWait method inside a try-catch block.
Since setProviderAndWait can throw an exception if the provider initialization fails, it's important to handle it safely to prevent unexpected crashes during runtime.

Changes made:

  • Updated the main usage example to wrap setProviderAndWait with a try-catch.
  • Updated the synchronous usage section with a try-catch block and explanatory comment.

Why?

  • Improves the reliability and production-readiness of the documentation examples.
  • Helps users adopt better error handling practices from the start.

Checklist:

  • Added try-catch around setProviderAndWait
  • Updated both main and synchronous usage sections
  • Ensured formatting matches the current README style

Signed-off-by: Abhay <abhayakg123@gmail.com.com>
abhayguptas requested review from a team as code owners April 27, 2025 10:46
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>

Copy link
Copy Markdown

aepfli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you! This excellent addition helps us normalize our documentation throughout our SDK landscape.

PS: I fixed the checkstyle issues, so we can go ahead with merging, as soon as we have all the approvals

codecov Bot commented Apr 28, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.25%. Comparing base (99faaf8) to head (bc96bfe).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1433      +/-   ##
============================================
+ Coverage     92.81%   93.25%   +0.44%     
- Complexity      469      471       +2     
============================================
  Files            43       43              
  Lines          1127     1127              
  Branches         91       91              
============================================
+ Hits           1046     1051       +5     
+ Misses           53       48       -5     
  Partials         28       28              
Flag Coverage Δ
unittests 93.25% <ø> (+0.44%) ⬆️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

aepfli merged commit 96cf9c7 into open-feature:main Apr 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

[DOC] Clarify the behavior of setProviderAndWait

4 participants


Back | FazBrowse Home | New Git URL