-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Arg validation clean up #11893
Arg validation clean up #11893
Conversation
@@ -79,7 +77,7 @@ public TimeSpan MaxAutoLockRenewalDuration | |||
{ | |||
if (value.HasValue) | |||
{ | |||
TimeoutHelper.ThrowIfNegativeArgument(value.Value, nameof(MaxReceiveWaitTime)); | |||
Argument.AssertPositive(value.Value, nameof(MaxReceiveWaitTime)); |
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.
This should actually be positive rather than just non-negative.
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.
I assume the result of Argument.AssertNotNegative
and Argument.AssertPositive
will be the same, both will throw for negative value? if yes, then why do have 2 different methods?
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.
AssertNotNegative allows >= 0
AssertPositive allows > 0
@@ -79,7 +77,7 @@ public TimeSpan MaxAutoLockRenewalDuration | |||
{ | |||
if (value.HasValue) | |||
{ | |||
TimeoutHelper.ThrowIfNegativeArgument(value.Value, nameof(MaxReceiveWaitTime)); | |||
Argument.AssertPositive(value.Value, nameof(MaxReceiveWaitTime)); |
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.
I assume the result of Argument.AssertNotNegative
and Argument.AssertPositive
will be the same, both will throw for negative value? if yes, then why do have 2 different methods?
@JoshLove-msft PR looks good to me. Thanks for cleaning this up. |
Get rid of using the Track 1 Fx/ExceptionUtilities in favor of using Azure Core Argument methods. Also deleted a few other unused files.