Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Check error message #10522

Open
1 of 3 tasks
maridematte opened this issue Aug 14, 2024 · 0 comments · May be fixed by #10914
Open
1 of 3 tasks

Better Check error message #10522

maridematte opened this issue Aug 14, 2024 · 0 comments · May be fixed by #10914
Assignees
Labels
Area: BuildCheck Priority:1 Work that is critical for the release, but we could probably ship without triaged

Comments

@maridematte
Copy link
Contributor

maridematte commented Aug 14, 2024

BuildCheck needs better error messages when a Check fails. When that happens we get a generic error message instead of the intended one that a Check has failed:

error MSB4184: The expression "[MSBuild]::RegisterBuildCheck(CheckPath)" cannot be evaluated. The build stopped unexpectedly because of an unexpected logger failure.

This is not helpful for debugging and creates more confusion than necessary.

Better error handling on:

  • Custom Check Initialization
  • Custom Check register action
  • Custom Check registered actions
@maridematte maridematte added Area: BuildCheck Priority:1 Work that is critical for the release, but we could probably ship without triaged labels Aug 14, 2024
@maridematte maridematte self-assigned this Aug 20, 2024
maridematte added a commit that referenced this issue Sep 6, 2024
Partial fix of #10522

Context
When a Check throws an exception it falls with an internal logger exception and crashes the build. This is not ideal. It decided that when a Check fails, we do not fail the build, just give a warning and deregister the check.

Changes Made
Changed the BuildCheck logger to catch initialization exceptions, and dispatch them as warnings and not errors.

Testing
Added end to end test with a sample custom check that throws an exception.

Notes
This is just a catch for exception on Check initialization. There are tests added for other cases but the fix will be different for them, so it will be done in another PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: BuildCheck Priority:1 Work that is critical for the release, but we could probably ship without triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant