private void LogErrors(object sender, ExceptionReceivedEventArgs e) { if (e.Exception == null || e.Exception is OperationCanceledException) { return; } HandleException(e.Exception); }