private async Task HandleCommandPublisherException(CommandPublisherExceptionContext context) { try { await _commandPublisherExceptionHandler.Handle(context).ConfigureAwait(false); } catch (Exception unhandleable) { Trace.TraceError(unhandleable.ToString()); } }
private async Task TryFlushCommands( T processManager, CancellationToken cancellationToken) { try { await _commandPublisher.FlushCommands(processManager.Id, cancellationToken).ConfigureAwait(false); } catch (Exception exception) { var context = new CommandPublisherExceptionContext(typeof(T), processManager.Id, exception); await HandleCommandPublisherException(context).ConfigureAwait(false); if (context.Handled == false) { throw; } } }