#include <Exception.hpp>
Public Methods | |
Exception (char *throwerString="unknown thrower",char *whatString="unknown exception") | |
~Exception () | |
void | writeMessage (ostream &os=cerr) |
This is the base Exception class that all other exceptions should inherit from. Some guidelines for using Exception:
(1) Define your main function as "int AppMain(int argc, char *argv[])" rather than the normal "main" function. (2) When throwing an exception from a class (e.g., MyClass), do
" throw Exception("MyClass", "description of exception");" (3) If you want to process the exception, do
try { ... ... throw Exception("MyClass", "an exception"); } catch (Exception &ex) { process exception... }
(4) If the exception is not caught in the application, it will be caught be the main function in the lemur toolkit. The default exception handler prints the following message on stderr and terminates the program.
Exception [ by MyClass]: an exception Program aborted due to exception
(5) You can define more specific exceptions by subclassing Exception. All exceptions will be caught by the default main function if not caught by an application.
|
|
|
|
|
|