41 #ifndef DiracException_h
42 #define DiracException_h
102 const std::string& errorMessage,
187 #define DIRAC_LOG_EXCEPTION(exception) \
189 if(exception.GetSeverityCode()!=SEVERITY_NO_ERROR) \
190 std::cerr << exception.GetErrorMessage(); \
196 #define DIRAC_THROW_EXCEPTION(arg1,arg2,arg3) \
198 DiracException exception(arg1,arg2, arg3); \
199 DIRAC_LOG_EXCEPTION(exception) \
206 #define DIRAC_CATCH_AND_RETHROW() \
207 catch (const DiracException& e) { \
208 DiracException exception(e); \
209 DIRAC_LOG_EXCEPTION(exception)\
215 #endif // DiracException_h
DiracSeverityCode mSeverityCode
Severity of exception.
Definition: dirac_exception.h:157
DiracSeverityCode GetSeverityCode() const
Get the severity level of this exception.
std::string mErrorMessage
The error message.
Definition: dirac_exception.h:162
Definition: dirac_exception.h:81
Definition: dirac_exception.h:76
std::string GetErrorMessage() const
Get the error message of this exception.
Definition: dirac_exception.h:64
Definition: dirac_exception.h:66
Definition: dirac_exception.h:65
DiracErrorCode
Enumeration of Dirac-defined error codes.
Definition: dirac_exception.h:58
DiracException & operator=(const DiracException &)
Definition: dirac_exception.h:67
virtual ~DiracException()
Destructor.
Definition: dirac_exception.h:60
DiracErrorCode GetErrorCode() const
Get the error code of this exception.
DiracErrorCode mErrorCode
The error code of this exception.
Definition: dirac_exception.h:152
Definition: dirac_exception.h:79
Definition: dirac_exception.h:78
std::ostream & operator<<(std::ostream &stream, TwoDArray< T > &array)
A function for extracting array data.
Definition: arrays.h:565
Definition: dirac_exception.h:80
Definition: dirac_exception.h:61
DiracSeverityCode
Error-severity states.
Definition: dirac_exception.h:75
Definition: dirac_exception.h:59
Definition: dirac_exception.h:68
Definition: dirac_exception.h:77
Definition: dirac_exception.h:63
Definition: dirac_exception.h:62
DiracException(const DiracErrorCode &errorCode, const std::string &errorMessage, const DiracSeverityCode &severityCode)
Construct from error source ID, error code, and message.
DiracException is the class which should be used for all exceptions within Dirac. ...
Definition: dirac_exception.h:88