casa
$Rev:20696$
|
Base class for all AIPS++ library errors. More...
#include <Error.h>
Public Types | |
enum | Category { BOUNDARY, INITIALIZATION, INVALID_ARGUMENT, CONFORMANCE, ENVIRONMENT, SYSTEM, PERMISSION, GENERAL } |
Public Member Functions | |
virtual const char * | what () const throw () |
Simply returns the stored error message. | |
const String & | getMesg () const |
String | getStackTrace () const |
AipsError::Category | getCategory () const |
void | setMessage (const String &msg) const |
Append a message. | |
AipsError (const Char *str, Category c=GENERAL) | |
Creates an AipsError and initializes the error message from the parameter. | |
AipsError (const String &str, Category c=GENERAL) | |
AipsError (const String &msg, const String &filename, uInt lineNumber, Category c=GENERAL) | |
AipsError (Category c=GENERAL) | |
~AipsError () throw () | |
Destructor which does nothing. | |
Static Public Member Functions | |
static String | generateStackTrace () |
static void | getLastInfo (String &message, String &stackTrace) |
static String | getLastMessage () |
static String | getLastStackTrace () |
static void | clearLastInfo () |
static String | noMessage () |
static String | noStackTrace () |
Protected Member Functions | |
void | addStackTrace () |
Protected Attributes | |
String | message |
Category | category |
String | stackTrace |
Static Protected Attributes | |
static String | lastMessage |
static String | lastStackTrace |
static Mutex | lastErrorMutex |
Base class for all AIPS++ library errors.
Public interface
This is the base class for all of the AIPS++ error classes. Because all of the errors have a common base class, any error can be caught with a single catch statement.
This class has a string which allows error messages to be propagated.
Tip: The string member must be handled very carefully because string is also derived from cleanup, thus the message;makePermanent()
call in the implementation of the constructors; This prevents the String from being cleaned up in the middle of an exception;
throw(AipsError("SOME STRING"));
casa::AipsError::AipsError | ( | const Char * | str, |
Category | c = GENERAL |
||
) |
Creates an AipsError and initializes the error message from the parameter.
casa::AipsError::AipsError | ( | const String & | str, |
Category | c = GENERAL |
||
) |
casa::AipsError::AipsError | ( | const String & | msg, |
const String & | filename, | ||
uInt | lineNumber, | ||
Category | c = GENERAL |
||
) |
casa::AipsError::~AipsError | ( | ) | throw () |
Destructor which does nothing.
void casa::AipsError::addStackTrace | ( | ) | [protected] |
static void casa::AipsError::clearLastInfo | ( | ) | [static] |
static String casa::AipsError::generateStackTrace | ( | ) | [static] |
AipsError::Category casa::AipsError::getCategory | ( | ) | const [inline] |
static void casa::AipsError::getLastInfo | ( | String & | message, |
String & | stackTrace | ||
) | [static] |
static String casa::AipsError::getLastMessage | ( | ) | [static] |
static String casa::AipsError::getLastStackTrace | ( | ) | [static] |
const String& casa::AipsError::getMesg | ( | ) | const [inline] |
Definition at line 103 of file Error.h.
References message.
Referenced by casa::MSSelectionLogError::handleError().
String casa::AipsError::getStackTrace | ( | ) | const |
static String casa::AipsError::noMessage | ( | ) | [static] |
static String casa::AipsError::noStackTrace | ( | ) | [static] |
void casa::AipsError::setMessage | ( | const String & | msg | ) | const [inline] |
virtual const char* casa::AipsError::what | ( | ) | const throw () [inline, virtual] |
Simply returns the stored error message.
Definition at line 101 of file Error.h.
References casa::String::c_str(), and message.
Category casa::AipsError::category [protected] |
Definition at line 143 of file Error.h.
Referenced by getCategory().
Mutex casa::AipsError::lastErrorMutex [static, protected] |
String casa::AipsError::lastMessage [static, protected] |
String casa::AipsError::lastStackTrace [static, protected] |
String casa::AipsError::message [protected] |
Definition at line 142 of file Error.h.
Referenced by getMesg(), setMessage(), and what().
String casa::AipsError::stackTrace [protected] |