Skip to content

Consider updating LogErrorFromException to take into account AggregateExceptions #7985

@jeffkl

Description

@jeffkl

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions