Skip to content

Commit

Permalink
Exception type field has been added to the error message (#178)
Browse files Browse the repository at this point in the history
* exception  type field has been added to the error message

* ExceptionType field has also been added for exceptions reported in MessageBusSubscriber
  • Loading branch information
VCuzmin authored Sep 21, 2021
1 parent 67f0c54 commit 7d58e11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ async Task MsgHandler(byte[] messageData)

var payload = new
{
ExceptionType = ex.GetType(),
ErrorMessage = ex.Message,
ex.StackTrace,
ex.Source,
Expand All @@ -82,6 +83,7 @@ async Task MsgHandler(byte[] messageData)
var envelopeString = System.Text.Encoding.UTF8.GetString(messageData);
var payload = new
{
ExceptionType = jsonReaderException.GetType(),
Data = envelopeString,
ErrorMessage = jsonReaderException.Message,
jsonReaderException.StackTrace,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public async Task Invoke(MessagingContext context, CancellationToken cancellatio

await _messageBusPublisher.PublishAsync(new
{
ExceptionType = ex.GetType(),
ErrorMessage = ex.Message,
ex.StackTrace,
ex.Source,
Expand Down

0 comments on commit 7d58e11

Please sign in to comment.