Module Exceptions
Changes made in the current development cycle can be
found in the changelog.
Exception handling
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
Synopsis
This module provides the exception handling mechanism used in AIPS++.
It allows the user to define new exception types and to throw,
catch, and rethrow these exceptions. The interface
to this exception handling mechanism is very similary to the ANSI standard
exceptions. This will make it easy to switch when the time comes.
This module supplies several common exception types .
These provide examples for creating new errors.
At some point, this exception mechanism will probably be replaced with
compiler supported exceptions.
Example
This example shows how a more specific exception can be caught as
a more general exception:
#include <casa/Exceptions.h>
#include <iostream>
main() {
try {
throw(indexError<int>(5,"Dummy error"));
} catch (IndexError xx) {
cout << "caught IndexError" << endl;
}
}
- AbortError -- Exception which halts execution (full description)
- AipsError -- Base class for all AIPS++ library errors (full description)
- AllocError -- Allocation errors (full description)
- DuplError -- Duplicate key errors (full description)
- IndexError -- Base class for all indexing errors (full description)
- duplError -- Duplicate key errors where the bad key is returned (full description)
- indexError -- Index errors returning the bad index (full description)