-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Replace Requires.NotNullOrEmpty(string) with ArgumentException.ThrowIfNullOrEmpty
#19197
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
Replace Requires.NotNullOrEmpty(string) with ArgumentException.ThrowIfNullOrEmpty
#19197
Conversation
|
@daxian-dbw Please mark |
|
PowerShell-CI-macos (Test for macOS mac Test - UnelevatedPesterTests - Others test failure: #19198 |
|
I think this change is fine. But you need to rebase with the master, because #19133 introduces another use of the |
375a8c8 to
f16cb79
Compare
daxian-dbw
left a comment
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.
LGTM
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
🎉 Handy links: |
Breaking change: Bucket 3: Unlikely Grey Area
This PR makes changes to public APIs so that an
ArgumentExceptionis thrown instead ofArgumentNullExceptionwhen a string is empty rather than null.If a consumer caught the
ArgumentNullExceptionand not the base classArgumentExceptionthis is a change in behavior.However, it seems unlikely to depend on a specific exception being thrown, because if specific behavior was required, the caller could have implemented the necessary business logic.