casa
5.7.0-16
|
default FITS error handling function, typdef, and enumeration More...
#include <FITSError.h>
Public Types | |
enum | ErrorLevel { INFO, WARN, SEVERE } |
WARN means that the FITS file is still usable - this generally happens when parsing the HDU and some minor, recoverable violation of the FITS rules is detected. More... | |
Static Public Member Functions | |
static void | defaultHandler (const char *errMessage, ErrorLevel severity) |
The default error handler. More... | |
default FITS error handling function, typdef, and enumeration
Public interface
FITSError contains the enumeration specifying the possible error message levels. It also contains the default error handling function for the FITS classes.
This example shows how one could set up an error handler which does what the FITS classes originally did - just send the error message to cout without any indication as to the severity of the error message.
Any error messages generated by fin will be sent to cout. Error handlers for the HDUs would need to be indicated in their constructors. For example:
The default error handler is FITSError::defaultHandler which sends the error message to the global log sink at the severity implied by ErrorLevel.
The error handler only handles the error messages. It is up to the programmer to check for the error status of classes like FitsInput.
Originally, FITS error message were simply sent to an ostream. In order to have these error messages go to the Casacore logger by default, this class was added. This was made a separate class because both BlockIo and FITS need to use this class. The anticipated replacements for the current FITS classes use a somewhat similar scheme.
Definition at line 86 of file FITSError.h.
WARN means that the FITS file is still usable - this generally happens when parsing the HDU and some minor, recoverable violation of the FITS rules is detected.
SEVERE means that a fatal error has occurred and the FITS file can not be properly processed.
Enumerator | |
---|---|
INFO | |
WARN | |
SEVERE |
Definition at line 95 of file FITSError.h.
|
static |
The default error handler.
The errMessage is posted to the global log sink at the severity implied by ErrorLevel. It is assumed that errMessage is null terminated.