std
std.atomic
std.exception
std.intrinsic
std.memory
std.stdarg
std.thread
|
|
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 InvalidUtfException: object.Exception;
- Thrown on an invalid UTF 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. |
- voidC 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. |
- voidC onOutOfMemory();
- A callback for out of memory errors in D. An OutOfMemoryException will be
thrown.
- voidC 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. |
- voidC 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. |
- voidC onInvalidUtfError(char[] msg, uint idx);
- A callback for internal UTF errors in D. An InvalidUtfException will be
thrown.
Params:
char[] msg |
Information about the error. |
uint idx |
String index where this error was detected. |
|