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)\
Definition of class SequenceHeaderByteIO.
Definition accessunit_byteio.h:52
std::ostream & operator<<(std::ostream &stream, TwoDArray< T > &array)
A function for extracting array data.
Definition arrays.h:565
DiracSeverityCode
Error-severity states.
Definition dirac_exception.h:75
@ SEVERITY_ACCESSUNIT_ERROR
Definition dirac_exception.h:79
@ SEVERITY_TERMINATE
Definition dirac_exception.h:81
@ SEVERITY_PICTURE_ERROR
Definition dirac_exception.h:78
@ SEVERITY_WARNING
Definition dirac_exception.h:77
@ SEVERITY_SEQUENCE_ERROR
Definition dirac_exception.h:80
@ SEVERITY_NO_ERROR
Definition dirac_exception.h:76
DiracErrorCode
Enumeration of Dirac-defined error codes.
Definition dirac_exception.h:58
@ ERR_INVALID_PICTURE_RATE
Definition dirac_exception.h:63
@ ERR_INVALID_INIT_DATA
Definition dirac_exception.h:68
@ ERR_INVALID_MOTION_VECTOR_PRECISION
Definition dirac_exception.h:67
@ ERR_UNSUPPORTED_STREAM_DATA
Definition dirac_exception.h:59
@ ERR_INVALID_PIXEL_ASPECT_RATIO
Definition dirac_exception.h:65
@ ERR_INVALID_VIDEO_DEPTH
Definition dirac_exception.h:66
@ ERR_INVALID_SIGNAL_RANGE
Definition dirac_exception.h:64
@ ERR_END_OF_STREAM
Definition dirac_exception.h:60
@ ERR_INVALID_VIDEO_FORMAT
Definition dirac_exception.h:61
@ ERR_INVALID_CHROMA_FORMAT
Definition dirac_exception.h:62
DiracException is the class which should be used for all exceptions within Dirac.
Definition dirac_exception.h:89
std::string mErrorMessage
The error message.
Definition dirac_exception.h:162
DiracErrorCode GetErrorCode() const
Get the error code of this exception.
DiracException(const DiracErrorCode &errorCode, const std::string &errorMessage, const DiracSeverityCode &severityCode)
Construct from error source ID, error code, and message.
virtual ~DiracException()
Destructor.
DiracException(const DiracException &src)
Copy constructor.
DiracErrorCode mErrorCode
The error code of this exception.
Definition dirac_exception.h:152
DiracException & operator=(const DiracException &)
std::string GetErrorMessage() const
Get the error message of this exception.
DiracSeverityCode GetSeverityCode() const
Get the severity level of this exception.
DiracSeverityCode mSeverityCode
Severity of exception.
Definition dirac_exception.h:157