Skip to content

Commit

Permalink
(#150) Use ExceptionInfo instead of Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pardahlman committed Dec 19, 2016
1 parent ed342b3 commit 4794dbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/RawRabbit/ErrorHandling/DefaultStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,16 @@ public virtual async Task OnSubscriberExceptionAsync(IRawConsumer consumer, Subs
await _topologyProvider.DeclareExchangeAsync(_errorExchangeCfg);
var channel = await _channelFactory.GetChannelAsync();
var msg = _serializer.Deserialize(args);
var actualException = UnwrapInnerException(exception);
var errorMsg = new HandlerExceptionMessage
{
Exception = exception,
Exception = new ExceptionInformation
{
ExceptionType = actualException.GetType().FullName,
InnerMessage = actualException.InnerException?.Message,
Message = actualException.Message,
StackTrace = actualException.StackTrace
},
Time = DateTime.Now,
Host = Environment.MachineName,
Message = msg,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using RawRabbit.Exceptions;

namespace RawRabbit.ErrorHandling
{
Expand All @@ -7,6 +8,6 @@ public class HandlerExceptionMessage
public string Host { get; set; }
public DateTime Time { get; set; }
public object Message { get; set; }
public Exception Exception { get; set; }
public ExceptionInformation Exception { get; set; }
}
}

0 comments on commit 4794dbb

Please sign in to comment.