Skip to content

Improve plugin error logging#6359

Closed
cdmihai wants to merge 12 commits intodotnet:mainfrom
cdmihai:improvePluginExceptionLogging
Closed

Improve plugin error logging#6359
cdmihai wants to merge 12 commits intodotnet:mainfrom
cdmihai:improvePluginExceptionLogging

Conversation

@cdmihai
Copy link
Copy Markdown
Contributor

@cdmihai cdmihai commented Apr 20, 2021

Depends on the changes in #6345. Merge that one in first.
These are the isolated diffs for this PR: https://github.com/dotnet/msbuild/pull/6359/files/1472b628aa65b2743b3abf068bcc2e4dc107c9f9..b9e1d9b2e51636d6cf1dae07cc53c119ee090464

Context

Treat project cache exceptions similar to how MSBuild treats exceptions from ILogger.Initialize and ILogger.Shutdown. This avoids the "file an issue against the MSBuild team" console messages.
Treat errors logged by the project cache similar to how MSBuild treats errors logged by tasks. Which is to check whether they logged an error and if yes, shut the build down (project cache does not do "continue on error").

Changes Made

  • Adds a ProjectCacheException which gets handled similarly to LoggerException

Testing

  • Beefed up the existing exception handling tests to also assert what happens when the project cache logs errors instead of throwing exceptions.

Comment thread ref/Microsoft.Build/net/Microsoft.Build.cs Outdated
In this case the exception is not what the cache printed, but MSBuild's message that the cache logged an error
@dotnet dotnet deleted a comment from azure-pipelines Bot Apr 22, 2021
@cdmihai
Copy link
Copy Markdown
Contributor Author

cdmihai commented Apr 22, 2021

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant