Beispiel #1
0
        /// <inheritdoc />
        public async Task HandleAsync(T command)
        {
            try
            {
                await _decoratedCommandHandler.HandleAsync(command);

                await _commandLogger.LogAsync(command, null);
            }
            catch (DomainException exception)
            {
                throw new CommandHandlerBadRequestException(exception.Message);
            }
            catch (CommandValidationException exception)
            {
                throw new CommandHandlerBadRequestException(exception.Message);
            }
            catch (Exception exception)
            {
                await _commandLogger.LogAsync(command, exception);

                throw new CommandHandlerException(exception.Message);
            }
        }