AggregateException

This commit is contained in:
Ben Adams
2017-11-13 12:14:12 +00:00
parent d4bf1639c7
commit 5eb9c25574
2 changed files with 97 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
// Copyright (c) Ben A Adams. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic.Enumerable;
using System.Reflection;
namespace System.Diagnostics
@@ -20,6 +21,14 @@ namespace System.Diagnostics
stackTraceString.SetValue(exception, stackTrace.ToString());
}
if (exception is AggregateException aggEx)
{
foreach (var ex in EnumerableIList.Create(aggEx.InnerExceptions))
{
ex.Demystify();
}
}
exception.InnerException?.Demystify();
}
catch