Browse Source

Add InvalidOperation and unknown error handling

pull/324/head
Ionite 1 year ago
parent
commit
55d85cdddf
No known key found for this signature in database
  1. 8
      StabilityMatrix.Avalonia/Services/AccountsService.cs

8
StabilityMatrix.Avalonia/Services/AccountsService.cs

@ -161,6 +161,10 @@ public class AccountsService : IAccountsService
{
logger.LogWarning("Timed out while fetching Lykos Auth user info");
}
catch (InvalidOperationException e)
{
logger.LogWarning(e, "Failed to get authentication token");
}
catch (ApiException e)
{
if (e.StatusCode is HttpStatusCode.Unauthorized) { }
@ -169,6 +173,10 @@ public class AccountsService : IAccountsService
logger.LogWarning(e, "Failed to get user info from Lykos");
}
}
catch (Exception e)
{
logger.LogError(e, "Unknown error while refreshing Lykos account status");
}
}
OnLykosAccountStatusUpdate(LykosAccountStatusUpdateEventArgs.Disconnected);

Loading…
Cancel
Save