core.exception

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

Members

Aliases

AssertHandler
alias AssertHandler = void function(string file, size_t line, string msg) nothrow

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

Classes

ArrayIndexError
class ArrayIndexError

Thrown when an out of bounds array index is accessed.

ArraySliceError
class ArraySliceError

Thrown when an out of bounds array slice is created

AssertError
class AssertError

Thrown on an assert error.

FinalizeError
class FinalizeError

Thrown on finalize error.

ForkError
class ForkError

Thrown on a configuration error.

InvalidMemoryOperationError
class InvalidMemoryOperationError

Thrown on an invalid memory operation.

OutOfMemoryError
class OutOfMemoryError

Thrown on an out of memory error.

RangeError
class RangeError

Thrown on a range error.

SwitchError
class SwitchError

Thrown on a switch error.

UnicodeException
class UnicodeException

Thrown on a unicode conversion error.

Functions

_d_arraybounds
void _d_arraybounds(string file, uint line)

Called when an invalid array index/slice or associative array key is accessed

_d_arraybounds_index
void _d_arraybounds_index(string file, uint line, size_t index, size_t length)

Called when an out of range array index is accessed

_d_arraybounds_indexp
void _d_arraybounds_indexp(immutable(char*) file, uint line, size_t index, size_t length)

Called when an out of range array index is accessed

_d_arraybounds_slice
void _d_arraybounds_slice(string file, uint line, size_t lower, size_t upper, size_t length)

Called when an out of range slice of an array is created

_d_arraybounds_slicep
void _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

_d_arrayboundsp
void _d_arrayboundsp(immutable(char*) file, uint line)

Called when an invalid array index/slice or associative array key is accessed

_d_assertp
void _d_assertp(immutable(char)* file, uint line)

Function calls to these are generated by the compiler and inserted into the object code.

onArrayIndexError
noreturn onArrayIndexError(size_t index, size_t length, string file, size_t line)

A callback for array index out of bounds errors in D.

onArraySliceError
noreturn onArraySliceError(size_t lower, size_t upper, size_t length, string file, size_t line)

A callback for array slice out of bounds errors in D.

onAssertError
void onAssertError(string file, size_t line)

A 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.

onAssertErrorMsg
void onAssertErrorMsg(string file, size_t line, string msg)

A 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.

onFinalizeError
noreturn onFinalizeError(TypeInfo info, Throwable e, string file, size_t line)

A callback for finalize errors in D. A FinalizeError will be thrown.

onForkError
noreturn onForkError(string file, size_t line)

A callback for errors in the case of a failed fork in D. A ForkError will be thrown.

onInvalidMemoryOperationError
noreturn onInvalidMemoryOperationError(void* pretend_sideffect)

A callback for invalid memory operations in D. An InvalidMemoryOperationError will be thrown.

onOutOfMemoryError
noreturn onOutOfMemoryError(void* pretend_sideffect)

A callback for out of memory errors in D. An OutOfMemoryError will be thrown.

onRangeError
noreturn onRangeError(string file, size_t line)

A callback for general array bounds errors in D. A RangeError will be thrown.

onUnicodeError
noreturn onUnicodeError(string msg, size_t idx, string file, size_t line)

A callback for unicode errors in D. A UnicodeException will be thrown.

onUnittestErrorMsg
void onUnittestErrorMsg(string file, size_t line, string msg)

A 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.

Properties

assertHandler
AssertHandler assertHandler [@property getter]
void assertHandler [@property getter]

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

Meta