File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,11 @@ public static string GetMessage(this Exception exception) {
48
48
if ( exception == null )
49
49
return String . Empty ;
50
50
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 ) ) ;
53
54
54
- return exception . Message ;
55
+ return exception . GetInnermostException ( ) . Message ;
55
56
}
56
57
}
57
58
}
You can’t perform that action at this time.
0 commit comments