core.exception

The exception module defines all system-level exceptions and provides a mechanism to alter system-level error handling.

Types 13

private aliasdummy__switch_errorT = __switch_errorT!()

Thrown on a range error.

Constructors
this( string file = __FILE__, size_t line = __LINE__, Throwable next = null )
this( string msg, string file, size_t line, Throwable next = null )

Thrown when an out of bounds array index is accessed.

Fields
size_t indexIndex into array
size_t lengthLength of indexed array
private char[100] msgBuf
Constructors
this(size_t index, size_t length, string file = __FILE__, size_t line = __LINE__, Throwable next = null)

Thrown when an out of bounds array slice is created

Fields
size_t lowerLower/upper bound passed to slice: `array[lower .. upper]`
size_t lengthLength of sliced array
private char[120] msgBuf
Constructors
this(size_t lower, size_t upper, size_t length, string file = __FILE__, size_t line = __LINE__, Throwable next = null)

Thrown on an assert error.

Constructors
this( string file, size_t line )
this( Throwable next, string file = __FILE__, size_t line = __LINE__ )
this( string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null )

Thrown on finalize error.

Fields
Methods
string toString() const @safe
Constructors
this( TypeInfo ci, Throwable next, string file = __FILE__, size_t line = __LINE__ )
this( TypeInfo ci, string file = __FILE__, size_t line = __LINE__, Throwable next = null )

Thrown on an out of memory error.

Methods
string toString() const @trusted
private string superToString() @trusted
Constructors
this(string file = __FILE__, size_t line = __LINE__, Throwable next = null )
this(bool trace, string file = __FILE__, size_t line = __LINE__, Throwable next = null )

Thrown on an invalid memory operation.

An invalid memory operation error occurs in circumstances when the garbage collector has detected an operation it cannot reliably handle. The default D GC is not re-entrant, so this can happen due to allocations done from within finalizers called during a garbage collection cycle.

Methods
string toString() const @trusted
private string superToString() @trusted
Constructors
this(string file = __FILE__, size_t line = __LINE__, Throwable next = null )

Thrown on a configuration error.

Constructors
this( string file = __FILE__, size_t line = __LINE__, Throwable next = null )

Thrown on a switch error.

Constructors
this( string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null )
classUnicodeException : Exception

Thrown on a unicode conversion error.

Fields
size_t idx
Constructors
this( string msg, size_t idx, string file = __FILE__, size_t line = __LINE__, Throwable next = null )
aliasAssertHandler = void function(string file, size_t line, string msg) nothrow

Gets/sets assert hander. null means the default handler is used.

classSuppressTraceInfo : Throwable.TraceInfo
Methods
int opApply(scope int delegate(ref const(char[]))) const
int opApply(scope int delegate(ref size_t, ref const(char[]))) const
string toString() const
SuppressTraceInfo instance() @trusted @nogc pure nothrow

Functions 27

fnvoid __switch_errorT()(string file = __FILE__, size_t line = __LINE__) @trusted
private fnvoid rangeMsgPut(ref char[] r, scope const(char)[] e) @nogc nothrow pure @safeMini `std.range.primitives: put` for constructor of ArraySliceError / ArrayIndexError
fnAssertHandler assertHandler() @property @trusted nothrow @nogcditto
fnvoid assertHandler(AssertHandler handler) @property @trusted nothrow @nogcditto
fnvoid onAssertError( string file = __FILE__, size_t line = __LINE__ ) nothrowA callback for assert errors in D. The user-supplied assert handler will be called if one has been supplied, otherwise an AssertError will be thrown.
fnvoid onAssertErrorMsg( string file, size_t line, string msg ) nothrowA callback for assert errors in D. The user-supplied assert handler will be called if one has been supplied, otherwise an AssertError will be thrown.
fnvoid onUnittestErrorMsg( string file, size_t line, string msg ) nothrowA callback for unittest errors in D. The user-supplied unittest handler will be called if one has been supplied, otherwise the error will be written to stderr.
fnnoreturn onRangeError( string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogcA callback for general array bounds errors in D. A RangeError will be thrown.
fnnoreturn onArraySliceError( size_t lower = 0, size_t upper = 0, size_t length = 0, string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogcA callback for array slice out of bounds errors in D.
fnnoreturn onArrayIndexError( size_t index = 0, size_t length = 0, string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogcA callback for array index out of bounds errors in D.
fnnoreturn onFinalizeError( TypeInfo info, Throwable e, string file = __FILE__, size_t line = __LINE__ ) @trusted nothrowA callback for finalize errors in D. A FinalizeError will be thrown.
fnnoreturn onInvalidMemoryOperationError(void * pretend_sideffect = null, string file = __FILE__, size_t line = __LINE__) @trusted pure nothrow @nogcA callback for invalid memory operations in D. An InvalidMemoryOperationError will be thrown.
fnnoreturn onForkError( string file = __FILE__, size_t line = __LINE__ ) @trusted pure nothrow @nogcA callback for errors in the case of a failed fork in D. A ForkError will be thrown.
fnnoreturn onUnicodeError( string msg, size_t idx, string file = __FILE__, size_t line = __LINE__ ) @safe pureA callback for unicode errors in D. A UnicodeException will be thrown.
fnvoid _d_assertp(immutable(char) * file, uint line)These functions must be defined for any D program linked against this library. Function calls to these are generated by the compiler and inserted into the object code.
fnvoid _d_assert_msg(string msg, string file, uint line)
fnvoid _d_assert(string file, uint line)
fnvoid _d_unittestp(immutable(char) * file, uint line)
fnvoid _d_unittest_msg(string msg, string file, uint line)
fnvoid _d_unittest(string file, uint line)
fnvoid _d_arrayboundsp(immutable(char *) file, uint line)Called when an invalid array index/slice or associative array key is accessed
fnvoid _d_arraybounds(string file, uint line)ditto
fnvoid _d_arraybounds_slicep(immutable(char *) file, uint line, size_t lower, size_t upper, size_t length)Called when an out of range slice of an array is created
fnvoid _d_arraybounds_slice(string file, uint line, size_t lower, size_t upper, size_t length)ditto
fnvoid _d_arraybounds_indexp(immutable(char *) file, uint line, size_t index, size_t length)Called when an out of range array index is accessed
fnvoid _d_arraybounds_index(string file, uint line, size_t index, size_t length)ditto
fnT staticError(T, Args...)(auto ref Args args) if (is(T : Error))

Variables 2

private varAssertHandler _assertHandler
private varvoid[256] _store