47#ifndef GUM_EXCEPTIONS_H
48#define GUM_EXCEPTIONS_H
63#define GUM_ERROR_IN_EXPR(type, msg) throw(type(msg))
65#if defined(SWIG) || defined(GUM_FOR_SWIG)
67# define GUM_ERROR(type, msg) \
69 std::ostringstream err_stream; \
71 throw(type(err_stream.str())); \
73# define GUM_SHOWERROR(e) \
74 { std::cout << std::endl << (e).what() << std::endl; }
76# define GUM_ERROR(type, msg) \
78 std::ostringstream error_stream; \
79 error_stream << msg; \
80 throw(type(gum::_createMsg_(__FILE__, __FUNCTION__, __LINE__, error_stream.str()))); \
83# define GUM_SHOWERROR(e) \
85 std::cout << std::endl << __FILE__ << ":" << __LINE__ << " " << (e).what() << std::endl; \
86 std::cout << (e).errorCallStack() << std::endl; \
89# define GUM_SHOWERROR(e) \
90 { std::cout << std::endl << __FILE__ << ":" << __LINE__ << " " << (e).what() << std::endl; }
94#define GUM_MAKE_ERROR(TYPE, SUPERCLASS, MSG) \
95 class TYPE: public SUPERCLASS { \
97 explicit TYPE(const std::string& aMsg, const std::string& aType = MSG) : \
98 SUPERCLASS(aMsg, aType) {} \
99 TYPE(const TYPE& src) : SUPERCLASS(src) {} \
103# define GUM_SYNTAX_ERROR(msg, filename, line, column) \
105 std::ostringstream error_stream; \
106 error_stream << msg; \
107 throw(gum::SyntaxError(error_stream.str(), filename, line, column)); \
110# define GUM_SYNTAX_ERROR(msg, filename, line, column) \
112 std::ostringstream error_stream; \
113 error_stream << msg; \
114 throw(gum::SyntaxError(error_stream.str(), filename, line, column)); \
134 explicit Exception(std::string_view aMsg =
"", std::string_view aType =
"Generic error");
530#ifndef DOXYGEN_SHOULD_SKIP_THIS
531 std::string _createMsg_(std::string_view filename,
532 std::string_view function,
534 std::string_view msg);
600 "The Schedule MultiDim Table is abstract")
604 "The Schedule MultiDim Table is unknown")
608 "There exists another identical Schedule MultiDim Table")
614 "The Schedule operation is unknown")
618 "The Schedule operation is not available yet")
622 "The Schedule operation has not been executed yet")
626 "Several evidence/CPT are incompatible together (proba=0)")
644 "Possible incompatibility between score and prior")
658 std::string filename_;
662 std::string aFilename,
665 const std::string& aType =
"Syntax Error");
676#ifndef DOXYGEN_SHOULD_SKIP_THIS
677# ifndef GUM_NO_INLINE
Exception : The Schedule MultiDim Table is abstract.
Exception base for argument error.
Exception base for CPT error.
Error: An unknown error occurred while accessing a database.
Exception : default in label.
Exception : a similar element already exists.
Exception : a similar label already exists.
Exception : There exists another identical Schedule MultiDim Table.
Exception(std::string_view aMsg="", std::string_view aType="Generic error")
~Exception() override=default
Exception(const Exception &e)
GUM_NODISCARD std::string errorCallStack() const
Returns the error call stack.
GUM_NODISCARD std::string errorContent() const
Returns the message content.
GUM_NODISCARD const char * what() const noexcept override
GUM_NODISCARD std::string errorType() const
Returns the error type.
Exception base for factory error.
Exception : invalid state error.
Exception : fatal (unknown ?) error.
Exception base for graph error.
Exception : "hedge" (witness of non-identifiability) is detected in do-calculus / ID computations.
Exception : input/output problem.
Exception : several evidence are incompatible together (proba=0).
Error: The score already contains a different 'implicit' prior.
Exception : there is something wrong with an arc.
Exception: at least one argument passed to a function is not what was expected.
Exception: the number of arguments passed to a function is not what was expected.
Exception : existence of a directed cycle in a graph.
Exception : there is something wrong with an edge.
Exception : node does not exist.
Error: The database contains some missing values.
Error: A name of variable is not found in the database.
Exception : no child for a given node was found.
Exception : no neighbour to a given node was found.
Exception : no parent for a given node was found.
Exception : the element we looked for cannot be found.
Exception : there is something wrong with an implementation.
Exception : a pointer or a reference on a nullptr (0) object.
Exception : operation not allowed.
Exception : out of bound.
Exception : wrong subtype or subclass.
Error: Due to its weight, the prior is currently compatible with the score but if you change the weig...
Exception base for ScheduleMultiDim errors.
Exception base for ScheduleOperator errors.
Exception : problem with size.
Special exception for syntax errors in files.
Exception : wrong type for this operation.
Exception : The Schedule Operation is not available yet.
Exception : a looked-for element could not be found.
Exception : iterator does not point to any valid key.
Exception : generic error on iterator.
Exception : The Schedule Operation has not been executed yet.
Error: An unknown label is found in the database.
Exception : The Schedule MultiDim Table is unknown.
Exception : The Schedule Operation is unknown.
Exception: wrong PRMClassElement for this operation.
#define GUM_MAKE_ERROR(TYPE, SUPERCLASS, MSG)
gum is the global namespace for all aGrUM entities
Provides basic types used in aGrUM.