public async Task HandleErrorAsync <TCommand>(ICommandContext <TCommand> context, Exception exception, CommandErrorDelegate <TCommand> next) where TCommand : class, ICommand { try { await _engine.NotifyFailAsync(context.Message).ConfigureAwait(false); } catch (Exception discardException) { _logger.LogError(discardException, ex => $"Unable to discard message: {ex.Message}"); await next(context, exception).ConfigureAwait(false); } }
public Task HandleErrorAsync <TCommand>(ICommandContext <TCommand> context, Exception exception, CommandErrorDelegate <TCommand> next) where TCommand : class, ICommand { return(_engine.NotifyFailAsync(context.Message)); }