=head1 Exceptions Ermyth uses its own exceptions defined in F. The example used in this document will be C. =head2 Throwing an exception To throw an exception, you generally have the following possible syntaxes: =over =item throw nullpointer_exception () Throw an empty exception. =item throw nullpointer_exception (char const *fmt, ...) Throw an exception with a message. This constructor takes varargs like C does. =item throw nullpointer_exception (SRCINF, char const *fmt, ...) The same as above but include information about the current file, line and function. exception::what () will look like this: file.C(#line): function (): your message =back =head2 Adding a new exception Adding a new exception is as easy as adding a line of C. The F file has examples of adding exceptions. C is the exception class from which you want to inherit. That way, you can create an exception hierarchy within ermyth. =head2 List of exceptions =over =item nullpointer_exception Thrown whenever a pointer is a C pointer where it definately should not be. C should be used in cases where the event is not exceptional. =item balloc_exception Used internally by the block allocator for instance if there is no deallocator available. =item module_exception Currently only thrown if two modules are trying to register themselves with the same name. =item factory_exception Currently unused. =back