private void _asyncTaskQueue_TaskError(TaskQueueErrorEventArgs eventArgs) { _windowManager.ShowTaskError(eventArgs); if (eventArgs.TaskQueueErrorResponse == TaskQueueErrorResponse.Abort) { this.Dispatcher.InvokeShutdown(); } }
public void ShowTaskError(TaskQueueErrorEventArgs eventArgs) { var result = MessageBox .Show($"Error while processing task {eventArgs.Task}.\nDetails: {eventArgs.ThrownException}\nRetry?", "Error", MessageBoxButton.YesNoCancel); switch (result) { case MessageBoxResult.Cancel: eventArgs.TaskQueueErrorResponse = TaskQueueErrorResponse.Abort; break; case MessageBoxResult.Yes: eventArgs.TaskQueueErrorResponse = TaskQueueErrorResponse.Retry; break; case MessageBoxResult.No: eventArgs.TaskQueueErrorResponse = TaskQueueErrorResponse.Skip; break; default: throw new ArgumentOutOfRangeException(); } }
private void _queue_TaskError(TaskQueueErrorEventArgs eventArgs) { StaticLogger.Log($"Error while processing file. {eventArgs.ThrownException}"); }