public IGrammar MessageAttempts()
 {
     return(this[nameof(MessageAttempt)]
            .AsTable("If the message processing is")
            .Before(c => _message = new ErrorCausingMessage())
            .After(async c => await _bus.Send(_message)));
 }
        public void Handle(ErrorCausingMessage message, Envelope envelope, AttemptTracker tracker)
        {
            tracker.LastAttempt = envelope.Attempts;

            if (!message.Errors.ContainsKey(envelope.Attempts))
            {
                message.WasProcessed = true;

                return;
            }

            var type = GetExceptionType(message.Errors[envelope.Attempts]);
            var ex   = Activator.CreateInstance(type).As <Exception>();

            throw ex;
        }
 public async Task SendMessageWithNoErrors()
 {
     _message = new ErrorCausingMessage();
     await _bus.Send(_message);
 }
Exemple #4
0
 public void SendMessageWithNoErrors()
 {
     _message = new ErrorCausingMessage();
     _bus.Send(_message);
 }