Last update Mon Apr 3 19:38:54 2006
std
 std.array
 std.atomic
 std.bitarray
 std.exception
 std.intrinsic
 std.memory
 std.regexp
 std.thread
 std.traits
 std.unicode
 std.vararg

std.exception

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

Design Issues:

The Exception base class is required to live in the global object module, as it is used by the system for exception propogation.

Future Directions:

It may be useful to provide a means of determining whether an exception is currently in flight. This would require cooperation with the thread module to implement.

class ArrayBoundsException: object.Exception;
Thrown on an array bounds error.

class AssertException: object.Exception;
Thrown on an assert error.

class OutOfMemoryException: object.Exception;
Thrown on an out of memory error.

class SwitchException: object.Exception;
Thrown on a switch error.

class UnicodeException: object.Exception;
Thrown on a unicode conversion error.

void setAssertHandler(void(* h)(char[] file, uint line));
Overrides the default assert hander with a user-supplied version.

Params:
void(* h)(char[] file, uint line) The new assert handler.

void onAssert(char[] file, uint line);
A callback for assert errors in D. The user-supplied assert handler will be called if one has been supplied, otherwise an AssertException will be thrown.

Params:
char[] file The name of the file that signaled this error.
uint line The line number on which this error occurred.

void onOutOfMemory();
A callback for out of memory errors in D. An OutOfMemoryException will be thrown.

void onArrayBoundsError(char[] file, uint line);
A callback for array bounds errors in D. An ArrayBoundsException will be thrown.

Params:
char[] file The name of the file that signaled this error.
uint line The line number on which this error occurred.

void onSwitchError(char[] file, uint line);
A callback for switch errors in D. A SwitchException will be thrown.

Params:
char[] file The name of the file that signaled this error.
uint line The line number on which this error occurred.

void onUnicodeError(char[] msg, uint idx);
A callback for unicode errors in D. A UnicodeException will be thrown.

Params:
char[] msg Information about the error.
uint idx String index where this error was detected.