We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f748754 commit 0f01c7aCopy full SHA for 0f01c7a
1 file changed
Signum.Engine/Basics/ExceptionLogic.cs
@@ -62,17 +62,10 @@ static ExceptionEntity GetEntity(Exception ex)
62
63
entity.ExceptionType = ex.GetType().Name;
64
65
- var agex = ex as AggregateException;
66
- var exl = new List<Exception>();
67
- if (agex != null)
68
- foreach (var ex0 in agex.InnerExceptions)
69
- {
70
- exl.AddRange(ex0.Follow(e => e.InnerException));
71
- }
72
- else
73
- exl.AddRange(ex.Follow(e => e.InnerException));
+ var exceptions = ex is AggregateException agex ?
+ agex.InnerExceptions.SelectMany(inner => inner.Follow(e => e.InnerException)).ToList() :
+ ex.Follow(e => e.InnerException).ToList();
74
75
- var exceptions = exl.Distinct();
76
string messages = exceptions.ToString(e => e.Message, "\r\n\r\n");
77
string stacktraces = exceptions.ToString(e => e.StackTrace, "\r\n\r\n");
78
0 commit comments