1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

RGB Service - Update for RGB.NET exception changes

This commit is contained in:
Robert 2021-04-26 23:13:11 +02:00
parent 031470c331
commit 52d0efb90e

View File

@ -149,7 +149,13 @@ namespace Artemis.Core.Services
RemoveDevice(device);
List<Exception> providerExceptions = new();
void DeviceProviderOnException(object? sender, Exception e) => providerExceptions.Add(e);
void DeviceProviderOnException(object? sender, ExceptionEventArgs e)
{
if (e.IsCritical)
providerExceptions.Add(e.Exception);
else
_logger.Warning(e.Exception, "Device provider {deviceProvider} threw non-critical exception", deviceProvider.GetType().Name);
}
deviceProvider.Exception += DeviceProviderOnException;
deviceProvider.Initialize();