Represents an exception in the exception handling system. More...
Data Fields | |
const char * | name |
The name of this exception. | |
const char * | description |
The description of this exception. | |
const Exception * | super |
The supertype of this exception. |
Represents an exception in the exception handling system.
Exceptions are objects with a name
, a description
and a super-type
.
They are defined through the macro DEFINE_EXCEPTION
:
DEFINE_EXCEPTION(StackException, "Stack overflow", RuntimeException); DEFINE_EXCEPTION(StackOverflowException, "Stack overflow", StackException); DEFINE_EXCEPTION(StackUnderflowException, "Stack underflow", StackException);
Exceptions are usually defined as global const
objects. There is a set of predefined exceptions built into the framework, amongst others:
RuntimeException
NotEnoughMemoryException
NullPointerException
FileOpenException
AbortException
ArithmeticException
IllegalInstructionException
BadPointerException
TerminationException
UserInterruptionException
RuntimeException
is the root of the exceptions pseudo-hierarchy. Any exception can be caught by a catch(RuntimeException)
block.
const char* Exception::description |
The description of this exception.
const char* Exception::name |
The name of this exception.
const Exception* Exception::super |
The supertype of this exception.