Skip to content

Commit d3b5d2f

Browse files
committed
Fixed Issue #4. Add additional logging when an error occurs while submitting an event.
1 parent 75be4f4 commit d3b5d2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/Shared/Extensions/ExceptionExtensions.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ public static string GetMessage(this Exception exception) {
4848
if (exception == null)
4949
return String.Empty;
5050

51-
if (exception is AggregateException)
52-
return String.Join(Environment.NewLine, ((AggregateException)exception).InnerExceptions.Where(ex => !String.IsNullOrEmpty(ex.Message)).Select(ex => ex.Message));
51+
var aggregateException = exception as AggregateException;
52+
if (aggregateException != null)
53+
return String.Join(Environment.NewLine, aggregateException.Flatten().InnerExceptions.Where(ex => !String.IsNullOrEmpty(ex.GetInnermostException().Message)).Select(ex => ex.GetInnermostException().Message));
5354

54-
return exception.Message;
55+
return exception.GetInnermostException().Message;
5556
}
5657
}
5758
}

0 commit comments

Comments
 (0)