File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,10 @@ static ExceptionEntity GetEntity(Exception ex)
62
62
63
63
entity . ExceptionType = ex . GetType ( ) . Name ;
64
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 ) ) ;
65
+ var exceptions = ex is AggregateException agex ?
66
+ agex . InnerExceptions . SelectMany ( inner => inner . Follow ( e => e . InnerException ) ) . ToList ( ) :
67
+ ex . Follow ( e => e . InnerException ) . ToList ( ) ;
74
68
75
- var exceptions = exl . Distinct ( ) ;
76
69
string messages = exceptions . ToString ( e => e . Message , "\r \n \r \n " ) ;
77
70
string stacktraces = exceptions . ToString ( e => e . StackTrace , "\r \n \r \n " ) ;
78
71
You can’t perform that action at this time.
0 commit comments