string GetErrorDescriptionFor(string messageId, bool brief = false)
        {
            if (brief)
            {
                return(_errorTracker.GetShortErrorDescription(messageId));
            }

            return(_errorTracker.GetFullErrorDescription(messageId));
        }
Example #2
0
        string GetErrorDescriptionFor(string messageId, bool brief = false)
        {
            var secondLevelMessageId = GetSecondLevelMessageId(messageId);

            if (brief)
            {
                var secondLevelErrorDescription = _errorTracker.GetShortErrorDescription(secondLevelMessageId);
                var firstLevelErrorDescription  = _errorTracker.GetShortErrorDescription(messageId);

                return(secondLevelErrorDescription == null
                    ? firstLevelErrorDescription
                    : string.Join(Environment.NewLine, firstLevelErrorDescription, secondLevelErrorDescription));
            }
            else
            {
                var secondLevelErrorDescription = _errorTracker.GetFullErrorDescription(secondLevelMessageId);
                var firstLevelErrorDescription  = _errorTracker.GetFullErrorDescription(messageId);

                return(secondLevelErrorDescription == null
                    ? firstLevelErrorDescription
                    : string.Join(Environment.NewLine, firstLevelErrorDescription, secondLevelErrorDescription));
            }
        }
Example #3
0
        public async Task Process(IncomingStepContext context, Func <Task> next)
        {
            if (context.Load <bool>(SimpleRetryStrategyStep.DispatchAsFailedMessageKey))
            {
                var originalMessage = context.Load <Message>();

                var messageId            = originalMessage.GetMessageId();
                var fullErrorDescription = _errorTracker.GetFullErrorDescription(messageId) ?? "(not available in the error tracker!)";
                var headers     = originalMessage.Headers;
                var body        = originalMessage.Body;
                var wrappedBody = WrapInFailed(headers, body, fullErrorDescription);

                context.Save(new Message(headers, wrappedBody));
            }

            await next();
        }
 public string GetFullErrorDescription(string messageId)
 {
     return(_innerErrorTracker.GetFullErrorDescription(messageId));
 }