See below for an overview of the classes in this module.
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 (see common exception types (file="Error.h")) . These provide examples for creating new errors.
At some point, this exception mechanism will probably be replaced with compiler supported exceptions.
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;
}
}
Modules | |
| Exceptions_internal_classes | |
| Internal Exceptions classes and functions. | |
Classes | |
| class | casa::AipsError |
| Base class for all AIPS++ library errors. More... | |
| class | casa::AllocError |
| Allocation errors. More... | |
| class | casa::IndexError |
| Base class for all indexing errors. More... | |
| class | casa::indexError< t > |
| Index errors returning the bad index. More... | |
| class | casa::DuplError |
| Duplicate key errors. More... | |
| class | casa::duplError< t > |
| Duplicate key errors where the bad key is returned. More... | |
| class | casa::AbortError |
| Exception which halts execution. More... | |
1.5.1