This exception is raised when a runtime code assertion has failed.
sealed class
|
FailedAssertionException
|
extends
|
TinmanException
|
Code
assertions
are
used
to
validate
the
current
application
state.
Evaluation
of
assertions
may
be
limited
to
DEBUG
mode
in
order
to
increase
performance.
For
critical
code
sections
(e.g.
detecting
buffer
underflows
and
overflows),
assertions
should
be
evaluated
in
both
DEBUG
and
RELEASE
mode.
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
|
The requested operation is not valid in the objects current lifecycle.
public
static
method
|
BadLifecycle
(string source,
ILifecycleState obj,
LifecycleState expected)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
obj
|
The object. | ||
expected
|
The expected lifecycle. | ||
returns
|
The ready-to-throw exception. |
The requested operation is not valid in the objects current lifecycle.
public
static
method
|
BadLifecycle
(string source,
ILifecycleState obj,
LifecycleState expectedA,
LifecycleState expectedB)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
obj
|
The object. | ||
expectedA
|
The expected lifecycle (first alternative). | ||
expectedB
|
The expected lifecycle (second alternative). | ||
returns
|
The ready-to-throw exception. |
The requested operation is not valid for the objects current state.
public
static
method
|
BadState
(string source,
string why = null)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
why
|
Why
is
the
operation
not
valid?
Defaults
to
null . |
||
returns
|
The ready-to-throw exception. |
A buffer overflow has occurred while writing to a memory buffer.
public
static
method
|
BufferOverflow
(string source)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
returns
|
The ready-to-throw exception. |
A buffer underflow has occurred while reading from a memory buffer.
public
static
method
|
BufferUnderflow
(string source)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
returns
|
The ready-to-throw exception. |
The class of a disposable object does not call its base DisposeManaged resp. DisposeUnmanaged method properly.
public
static
method
|
IllegalDispose
(string source,
IDisposable disposable)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
disposable
|
The object. | ||
returns
|
The ready-to-throw exception. |
The class of a initializable object does not call its base DoInitialize method properly.
public
static
method
|
IllegalInitialize
(string source,
IInitializable initializable)
|
||
type
|
FailedAssertionException
|
||
params
|
source
|
The error source (see ErrorSource). | |
initializable
|
The object. | ||
returns
|
The ready-to-throw exception. |
[Pure]
|
||||
public
override
sealed
method
|
ToString
()
|
|||
type
|
string
|
|||
inherited
|
TinmanException.ToString
|