提交 f415f1c2 编写于 作者: C CyrusNajmabadi

Unwrap targetinvocationexxceptions.

上级 8af46a22
......@@ -191,9 +191,14 @@ protected override void Dispose(bool finalize)
private static IList<Exception> Flatten(ICollection<Exception> exceptions)
{
var aggregate = new AggregateException(exceptions);
return aggregate.Flatten().InnerExceptions;
return aggregate.Flatten().InnerExceptions
.Select(UnwrapException)
.ToList();
}
private static Exception UnwrapException(Exception ex)
=> ex is TargetInvocationException targetEx ? (targetEx.InnerException ?? targetEx) : ex;
internal void AddTestSolution(TestHostSolution solution)
{
this.OnSolutionAdded(SolutionInfo.Create(solution.Id, solution.Version, solution.FilePath, projects: solution.Projects.Select(p => p.ToProjectInfo())));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册