The TaskLoggingHelper.LogErrorFromException() method should probably take into account an AggregateException and call itself multiple times for each inner exception.
|
public void LogErrorFromException(Exception exception, bool showStackTrace, bool showDetail, string file) |
It could also take into account special exceptions like InvalidProjectFileException which have project file information.
Here's what we did in NuGet to get a better experience when MSBuild APIs throw exceptions:
https://github.com/NuGet/NuGet.Client/pull/4809/files#diff-a1e0e948fb5d1439e0368357d8587e83fafe5d5bb1a4f3fad40b040b3b9bf022R1042-R1073