Skip to content

Commit 83840d2

Browse files
authored
feat(templates): improve Boilerplate exception handling #10998 (#10999)
1 parent d5bc512 commit 83840d2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/AuthManager.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,11 @@ public async Task SignOut(CancellationToken cancellationToken)
7575
{
7676
await userController.SignOut(cancellationToken);
7777
}
78-
catch (Exception exp) when (exp is ServerConnectionException or UnauthorizedException or ResourceNotFoundException)
78+
catch (Exception exp) when (exp is ServerConnectionException or UnauthorizedException or ResourceNotFoundException or ClientNotSupportedException)
7979
{
80-
// The user might sign out while the app is offline, making token refresh attempts fail.
81-
// These exceptions are intentionally ignored in this case.
80+
// If the client's access token is expired, the client would attempt to refresh it,
81+
// but if the client is offline or outdated, the refresh token request will fail.
82+
// These exceptions are intentionally ignored in these cases.
8283
}
8384
finally
8485
{

src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Core/Services/ClientExceptionHandlerBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ private ExceptionDisplayKind GetDisplayKind(Exception exception)
8080
if (exception is ServerConnectionException)
8181
return ExceptionDisplayKind.NonInterrupting;
8282

83+
if (exception is UnauthorizedException)
84+
return ExceptionDisplayKind.NonInterrupting;
85+
8386
return ExceptionDisplayKind.Interrupting;
8487
}
8588

0 commit comments

Comments
 (0)