|
casacore
|
#include <Error.h>
Public Types | |
| enum | Category { BOUNDARY , INITIALIZATION , INVALID_ARGUMENT , CONFORMANCE , ENVIRONMENT , SYSTEM , PERMISSION , GENERAL } |
Public Member Functions | |
| virtual const char * | what () const noexcept |
| 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 () noexcept | |
| Destructor which does nothing. | |
Static Public Member Functions | |
| static void | getLastInfo (String &message, String &stackTrace) |
| Get or clear the stacktrace info. | |
| static String | getLastMessage () |
| static String | getLastStackTrace () |
| static void | clearLastInfo () |
| static AipsError | repackageAipsError (AipsError &error, const String &message, const char *file, Int line, const char *func) |
| Repackage an exception. | |
| static void | throwIf (Bool condition, const String &message, const char *file, Int line, const char *func="") |
| Throw if the condition is true. | |
| static void | throwIfError (Int errorCode, const String &prefix, const char *file, Int line, const char *func="") |
| Throw if the system error code is not 0. | |
Protected Member Functions | |
| void | addStackTrace () |
| Add the stack trace to the message (if USE_STACKTRACE is set). | |
Protected Attributes | |
| String | message |
| Category | category |
| String | stackTrace |
Base class for all Casacore library errors
Public interface
This is the base class for all of the Casacore 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;
Creates an AipsError and initializes the error message from the parameter.
References GENERAL.
Referenced by casacore::AllocError::AllocError(), casacore::AllocError::AllocError(), casacore::DFTError::DFTError(), casacore::DFTError::DFTError(), casacore::DFTError::DFTError(), casacore::DuplError::DuplError(), casacore::DuplError::DuplError(), casacore::DuplError::DuplError(), casacore::FunctionFactoryError::FunctionFactoryError(), casacore::IndexError::IndexError(), casacore::IndexError::IndexError(), casacore::IndexError::IndexError(), casacore::MathFuncError::MathFuncError(), casacore::MathFuncError::MathFuncError(), casacore::MathFuncError::MathFuncError(), repackageAipsError(), and setMessage().
| casacore::AipsError::AipsError | ( | const String & | msg, |
| const String & | filename, | ||
| uInt | lineNumber, | ||
| Category | c = GENERAL ) |
References GENERAL.
|
noexcept |
Destructor which does nothing.
|
protected |
Add the stack trace to the message (if USE_STACKTRACE is set).
References addStackTrace().
Referenced by addStackTrace().
|
static |
References clearLastInfo().
Referenced by clearLastInfo().
|
inline |
Get or clear the stacktrace info.
References getLastInfo(), message, and stackTrace.
Referenced by getLastInfo().
|
static |
References getLastMessage().
Referenced by getLastMessage().
|
static |
References getLastStackTrace().
Referenced by getLastStackTrace().
|
inline |
Definition at line 146 of file Error.h.
References message.
Referenced by casacore::MSSelectionLogError::handleError().
| String casacore::AipsError::getStackTrace | ( | ) | const |
|
static |
Repackage an exception.
References AipsError(), message, and repackageAipsError().
Referenced by repackageAipsError().
|
inline |
Append a message.
This is used by LogIO when an exception is logged. The message is const to be able to use it for a temporary exception.
Definition at line 154 of file Error.h.
References AipsError(), and message.
|
inlinevirtualnoexcept |
|
protected |
Definition at line 202 of file Error.h.
Referenced by getCategory().
|
protected |
Definition at line 201 of file Error.h.
Referenced by casacore::MSSelectionError::addMessage(), casacore::MSSelectionError::changeMessage(), casacore::DataManError::DataManError(), casacore::DataManInternalError::DataManInternalError(), casacore::DataManInvOper::DataManInvOper(), dyscostman::DyscoStManError::DyscoStManError(), casacore::FunctionFactoryError::FunctionFactoryError(), getLastInfo(), getMesg(), casacore::HDF5Error::HDF5Error(), casacore::JsonError::JsonError(), casacore::MSSelectionAntennaError::MSSelectionAntennaError(), casacore::MSSelectionAntennaParseError::MSSelectionAntennaParseError(), casacore::MSSelectionArrayError::MSSelectionArrayError(), casacore::MSSelectionArrayParseError::MSSelectionArrayParseError(), casacore::MSSelectionArrayWarning::MSSelectionArrayWarning(), casacore::MSSelectionError::MSSelectionError(), casacore::MSSelectionFeedError::MSSelectionFeedError(), casacore::MSSelectionFeedParseError::MSSelectionFeedParseError(), casacore::MSSelectionFieldError::MSSelectionFieldError(), casacore::MSSelectionFieldParseError::MSSelectionFieldParseError(), casacore::MSSelectionFieldWarning::MSSelectionFieldWarning(), casacore::MSSelectionNullExpr::MSSelectionNullExpr(), casacore::MSSelectionNullSelection::MSSelectionNullSelection(), casacore::MSSelectionNullTEN::MSSelectionNullTEN(), casacore::MSSelectionObservationError::MSSelectionObservationError(), casacore::MSSelectionObservationParseError::MSSelectionObservationParseError(), casacore::MSSelectionObservationWarning::MSSelectionObservationWarning(), casacore::MSSelectionPolnError::MSSelectionPolnError(), casacore::MSSelectionPolnParseError::MSSelectionPolnParseError(), casacore::MSSelectionPolnWarning::MSSelectionPolnWarning(), casacore::MSSelectionScanError::MSSelectionScanError(), casacore::MSSelectionScanParseError::MSSelectionScanParseError(), casacore::MSSelectionScanWarning::MSSelectionScanWarning(), casacore::MSSelectionSpwError::MSSelectionSpwError(), casacore::MSSelectionSpwParseError::MSSelectionSpwParseError(), casacore::MSSelectionSpwWarning::MSSelectionSpwWarning(), casacore::MSSelectionStateError::MSSelectionStateError(), casacore::MSSelectionStateParseError::MSSelectionStateParseError(), casacore::MSSelectionStateWarning::MSSelectionStateWarning(), casacore::MSSelectionTimeError::MSSelectionTimeError(), casacore::MSSelectionTimeParseError::MSSelectionTimeParseError(), casacore::MSSelectionUvDistError::MSSelectionUvDistError(), casacore::MSSelectionUvDistParseError::MSSelectionUvDistParseError(), repackageAipsError(), casacore::MSSelectionError::reset(), setMessage(), casacore::TableArrayConformanceError::TableArrayConformanceError(), casacore::TableArrayConformanceError::TableArrayConformanceError(), casacore::TableConformanceError::TableConformanceError(), casacore::TableDuplFile::TableDuplFile(), casacore::TableError::TableError(), casacore::TableInternalError::TableInternalError(), casacore::TableInvColumnDesc::TableInvColumnDesc(), casacore::TableInvExpr::TableInvExpr(), casacore::TableInvExpr::TableInvExpr(), casacore::TableInvHyperDesc::TableInvHyperDesc(), casacore::TableInvOper::TableInvOper(), casacore::TableInvOpt::TableInvOpt(), casacore::TableInvSort::TableInvSort(), throwIf(), casacore::TSMError::TSMError(), and what().
|
protected |
Definition at line 203 of file Error.h.
Referenced by getLastInfo().