adjust displayed error on connection

This commit is contained in:
Stanley Dimant
2022-10-18 00:56:29 +02:00
parent 858cb225b9
commit b727d75ab6
3 changed files with 11 additions and 3 deletions

View File

@@ -205,6 +205,14 @@ public partial class ApiController : IDisposable, IMareHubClient
}
catch (HubException ex)
{
if (ex.Message.Contains("unauthorized", StringComparison.OrdinalIgnoreCase))
{
Logger.Warn(ex.Message);
ServerState = ServerState.Unauthorized;
await StopConnection(token).ConfigureAwait(false);
return;
}
Logger.Warn(ex.GetType().ToString());
Logger.Warn(ex.Message);
Logger.Warn(ex.StackTrace ?? string.Empty);