-
-
Notifications
You must be signed in to change notification settings - Fork 254
Improve Boilerplate exception handling (#10998) #10999
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
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughException handling in the boilerplate project's client code was updated. The Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant AuthManager
participant ExceptionHandler
Client->>AuthManager: SignOut()
AuthManager->>AuthManager: Try sign-out logic
alt Exception thrown
AuthManager->>AuthManager: Catch ServerConnectionException/UnauthorizedException/ResourceNotFoundException/ClientNotSupportedException
AuthManager->>AuthManager: Ignore exception
end
AuthManager-->>Client: Complete
Client->>ExceptionHandler: HandleException(exception)
alt exception is ServerConnectionException or UnauthorizedException
ExceptionHandler-->>Client: Display as NonInterrupting
else
ExceptionHandler-->>Client: Display as Interrupting
end
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Poem
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 refines how certain exceptions are handled in the client boilerplate by classifying UnauthorizedException as non-interrupting and extending the sign-out logic to ignore a new exception type.
- Classify
UnauthorizedExceptionasNonInterruptinginGetDisplayKind - Extend
AuthManager.SignOutto ignoreClientNotSupportedException - Update comments to explain ignored exception scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/.../ClientExceptionHandlerBase.cs | Added UnauthorizedException branch to return NonInterrupting |
| src/.../AuthManager.cs | Updated catch filter to include ClientNotSupportedException and revised comments |
Comments suppressed due to low confidence (2)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ClientExceptionHandlerBase.cs:83
- Add a unit test to ensure
UnauthorizedExceptionis classified asNonInterruptinginGetDisplayKindfor full coverage.
if (exception is UnauthorizedException)
src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AuthManager.cs:78
- Introduce a test case to verify that
ClientNotSupportedExceptionis correctly ignored duringSignOut.
catch (Exception exp) when (exp is ServerConnectionException or UnauthorizedException or ResourceNotFoundException or ClientNotSupportedException)
...lates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AuthManager.cs
Outdated
Show resolved
Hide resolved
…te.Client.Core/Services/AuthManager.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Yaser Moradi <ysmoradi@outlook.com>
closes #10998
Summary by CodeRabbit