An argument passed to a method has an illegal value.
sealed class
|
InvalidArgumentException
|
extends
|
TinmanException
|
Precondition constraints can be placed on method parameters by putting a special tag at the beginning of the corresponding parameter documentation:
[>n]
The
parameter
value
must
be
greater
than
the
given
boundary
n
.
[>=n]
The
parameter
value
must
be
greater
than
or
equal
to
the
given
boundary
n
.
[<n]
The
parameter
value
must
be
less
than
the
given
boundary.[<=n]
The
parameter
value
must
be
less
than
or
equal
to
the
given
boundary.
[not-empty]
The
parameter
value
must
not
be
empty
(e.g.
empty
strings,
array
or
collections).
[not-null]
The
parameter
value
must
not
be
null.[pow2]
The
parameter
value
must
be
a
power
of
two.[pow2+1]
The
parameter
value
must
be
a
power
of
two,
plus
one.[n..m]
The
parameter
value
must
lie
within
the
given
interval
(both
bounds
are
inclusive).
DEBUG
mode.
Passing
a
parameter
value
that
violates
a
precondition
constraint
in
RELEASE
mode
will
produce
undefined
results.
Each method of this class acts as a static factory method for creating an appropriate exception object for one of the above precondition constraints.
The TinmanError object that describes the error that has occurred.
public
property
|
ErrorInfo
{
get
}
|
||
type
|
TinmanError
|
||
value
|
|
The TinmanError object. | |
inherited
|
TinmanException.ErrorInfo
|
[Pure]
|
||||
public
override
sealed
property
|
Message
{
get
}
|
|||
type
|
string
|
|||
value
|
||||
inherited
|
TinmanException.Message
|
The error source (see ErrorSource).
public
property
|
Source
{
get
}
|
||
type
|
string
|
||
value
|
The error source tag. | ||
inherited
|
TinmanException.Source
|
Parameter value is invalid.
public
static
method
|
Custom
(string source,
string parameter,
string message = null)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The
parameter
name.
Separate
multiple
names
with
| . |
||
message
|
The
error
message.
Defaults
to
null . |
||
returns
|
The ready-to-throw exception. |
Parameter must be greater than the given value.
public
static
method
|
Greater
(string source,
string parameter,
int64 value)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
value
|
The value. | ||
returns
|
The ready-to-throw exception. |
Parameter must be greater than or equal to the given value.
public
static
method
|
GreaterEqual
(string source,
string parameter,
int64 value)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
value
|
The value. | ||
returns
|
The ready-to-throw exception. |
Parameter must be less than the given value.
public
static
method
|
Less
(string source,
string parameter,
int64 value)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
value
|
The value. | ||
returns
|
The ready-to-throw exception. |
Parameter must be less than or equal to the given value.
public
static
method
|
LessEqual
(string source,
string parameter,
int64 value)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
value
|
The value. | ||
returns
|
The ready-to-throw exception. |
Parameter must not be empty.
public
static
method
|
NotEmpty
(string source,
string parameter)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
returns
|
The ready-to-throw exception. |
Parameter must not be null.
public
static
method
|
NotNull
(string source,
string parameter)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
returns
|
The ready-to-throw exception. |
Parameter must be a power of two.
public
static
method
|
PowerOfTwo
(string source,
string parameter)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
returns
|
The ready-to-throw exception. |
Parameter must be a power of two plus one.
public
static
method
|
PowerOfTwoPlusOne
(string source,
string parameter)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
returns
|
The ready-to-throw exception. |
[Pure]
|
||||
public
override
sealed
method
|
ToString
()
|
|||
type
|
string
|
|||
inherited
|
TinmanException.ToString
|
Parameter value must be within a certain interval.
public
static
method
|
WithinInterval
(string source,
string parameter,
int64 lower,
int64 upper)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
lower
|
Inclusive lower allowed boundary value. | ||
upper
|
Inclusive upper allowed boundary value. | ||
returns
|
The ready-to-throw exception. |
Parameter value must be within a certain interval.
public
static
method
|
WithinInterval
(string source,
string parameter,
float64 lower,
float64 upper)
|
||
type
|
InvalidArgumentException
|
||
params
|
source
|
The error source (see ErrorSource). | |
parameter
|
The parameter name. | ||
lower
|
Inclusive lower allowed boundary value. | ||
upper
|
Inclusive upper allowed boundary value. | ||
returns
|
The ready-to-throw exception. |