mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-16 18:47:40 -05:00
Ignore hub exceptions but rethrow others
This commit is contained in:
@@ -100,14 +100,23 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service
|
|||||||
|
|
||||||
_database.StoreWeatherData(weatherMessage);
|
_database.StoreWeatherData(weatherMessage);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
if (_hubConnection.State == HubConnectionState.Disconnected)
|
if (_hubConnection.State == HubConnectionState.Disconnected)
|
||||||
_hubConnection.StartAsync().Wait();
|
_hubConnection.StartAsync().Wait();
|
||||||
|
|
||||||
_hubConnection.InvokeAsync("SendLatestReading", message).Wait();
|
_hubConnection.InvokeAsync("SendLatestReading", message).Wait();
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
|
{
|
||||||
|
WriteLog($"Hub exception: {exception}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
WriteLog($"Exception: {exception}");
|
WriteLog($"Exception: {exception}");
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user