File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -154,6 +154,20 @@ public static ArgumentOutOfRangeException ArgumentOutOfRange<T>(
154154 . LogToCodeTraceSourceBeforeThrow ( ) ;
155155 }
156156
157+ /// <summary>Creates <see cref="ArgumentOutOfRangeException"/> for an argument that must be positive.</summary>
158+ /// <param name="argumentName">Name of the argument.</param>
159+ /// <returns>Initialized instance of <see cref="ArgumentOutOfRangeException"/>.</returns>
160+ [ DebuggerHidden , MustUseReturnValue ]
161+ public static ArgumentOutOfRangeException ArgumentNegative ( [ InvokerParameterName ] string argumentName )
162+ {
163+ BreakIfAttached ( ) ;
164+ return
165+ new ArgumentOutOfRangeException (
166+ argumentName ,
167+ $ "The value of { argumentName } must be positive")
168+ . LogToCodeTraceSourceBeforeThrow ( ) ;
169+ }
170+
157171 /// <summary>Creates <see cref="IndexOutOfRangeException"/>.</summary>
158172 /// <param name="argumentName">Name of the argument.</param>
159173 /// <param name="value">The value.</param>
You can’t perform that action at this time.
0 commit comments