-
Notifications
You must be signed in to change notification settings - Fork 1.4k
cleanup ErrorUtilities #8990
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
cleanup ErrorUtilities #8990
Conversation
src/Build/BackEnd/Components/Communications/TranslatorExtensions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I can put them into Shared\Resources\Strings.shared.resx if you like? that is built into tasks, engine, utilities, task host, and exe. but then they are only in one file in the code. |
Works for me! Maybe get buyoff from someone who actually works on MSBuild, though 😅 |
|
What do you work on @Forgind ... entirely in SDK? |
|
Yup! |
Sounds good. I suppose this string would not change often (especially to extent of adding/removing fmting params) - but I definitely wouldn't complain to future-proof it by moving to single resx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking time to clean it.
|
feedback hopefully addressed |
|
(I removed some low value comments and formatting for todays less narrow monitors..) |
|
is this ready to merge? |
* cleanup errors * remove if debug * xlf
Moved resource string existence check (in debug) consistently outside of the condition. This detected cases where we were using an invalid resource string, but the condition was never false. Fixed these. Note, it doesn't need to be localized message or even probably the same exception type because almost by definition, these conditions have never been true, and possibly can never be true (otherwise they'd have hit the missing resource already). Also, change method to be debug-only so as to remove the #if.
Moved s_throwExceptions consistently inside the condition check as cleaner.
Move exception construction consistently out of the VerifyThrowXX methods so this cold path doesn't prevent them inlining.
Remove string formatting inside the condition in one place where string interpolation was happening.