Prevent logging reactor exceptions if expected due to cancellation

This commit is contained in:
Wizou 2021-09-01 23:11:18 +02:00
parent 67285c1c08
commit cd6d813845

View file

@ -558,9 +558,10 @@ namespace WTelegram
}
catch (OperationCanceledException)
{ }
catch (Exception ex) when (!ct.IsCancellationRequested)
catch (Exception ex)
{
Helpers.Log(5, $"An exception occured in the reactor: {ex}");
if (!ct.IsCancellationRequested)
Helpers.Log(5, $"An exception occured in the reactor: {ex}");
}
}