Skip to content

Conversation

@halgab
Copy link
Contributor

@halgab halgab commented Nov 8, 2023

This is a followup to #8403.

Description

Many error messages can be replaced with messages from the BCL using the new ArgumentOutOfRangeException throw helpers.
Here are the messages I removed, each in its own commit:

  • ParameterMustBeGreaterThanZero
  • ParameterCannotBeNegative
  • ParameterCannotBeGreaterThan
  • ParameterCannotBeLessThan
  • ParameterValueMustBeGreaterThanZero
  • ParameterValueCannotBeNegative
  • ShouldBeZero

ParameterMustBeBetween would be a good candidate, but this would slightly change the information conveyed by the error message. I still think it's worth it though.
ParameterValueCannotBeInfinity and ParameterValueCannotBeNaN also come to mind.

Customer Impact

Slight performance improvement, and a bit fewer resources.

Regression

No

Testing

CI

Risk

Low. I manually searched and removed the error messages, and let CA1512 finish the work

Microsoft Reviewers: Open in CodeFlow

@ghost ghost assigned halgab Nov 8, 2023
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Nov 8, 2023
@ghost ghost requested review from dipeshmsft and singhashish-wpf November 8, 2023 13:58
@ghost ghost added Community Contribution A label for all community Contributions draft labels Nov 8, 2023
@halgab halgab force-pushed the aoore-helpers-2 branch 2 times, most recently from d2a8181 to c557917 Compare November 8, 2023 22:52
@halgab halgab marked this pull request as ready for review November 9, 2023 08:34
@halgab halgab requested a review from a team as a code owner November 9, 2023 08:34
@ghost ghost removed the draft label Nov 9, 2023
@rchauhan18
Copy link
Contributor

@halgab
Copy link
Contributor Author

halgab commented Nov 24, 2023

I kept those because of the asserts. But I'd be happy to make the change!

@halgab
Copy link
Contributor Author

halgab commented Nov 24, 2023

I kept those because of the asserts. But I'd be happy to make the change!

Actually that's not true. Those fell off my radar because they're not part of the solution. I'll make the change.

@rchauhan18
Copy link
Contributor

Thanks @halgab for contributing!

@halgab halgab deleted the aoore-helpers-2 branch November 29, 2023 12:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants