1 #ifndef SYMENGINE_EXCEPTION_H
2 #define SYMENGINE_EXCEPTION_H
9 SYMENGINE_NO_EXCEPTION = 0,
10 SYMENGINE_RUNTIME_ERROR = 1,
11 SYMENGINE_DIV_BY_ZERO = 2,
12 SYMENGINE_NOT_IMPLEMENTED = 3,
13 SYMENGINE_DOMAIN_ERROR = 4,
14 SYMENGINE_PARSE_ERROR = 5,
15 SYMENGINE_SERIALIZATION_ERROR = 6,
16 } symengine_exceptions_t;
33 symengine_exceptions_t ec;
36 SymEngineException(
const std::string &msg, symengine_exceptions_t error)
37 : m_msg(msg), ec(error)
41 : SymEngineException(msg, SYMENGINE_RUNTIME_ERROR)
44 const char *what()
const throw()
override
48 symengine_exceptions_t error_code()
54 class DivisionByZeroError :
public SymEngineException
58 : SymEngineException(msg, SYMENGINE_DIV_BY_ZERO)
63 class NotImplementedError :
public SymEngineException
67 : SymEngineException(msg, SYMENGINE_NOT_IMPLEMENTED)
72 class DomainError :
public SymEngineException
76 : SymEngineException(msg, SYMENGINE_DOMAIN_ERROR)
81 class ParseError :
public SymEngineException
85 : SymEngineException(msg, SYMENGINE_PARSE_ERROR)
90 class SerializationError :
public SymEngineException
94 : SymEngineException(msg, SYMENGINE_SERIALIZATION_ERROR)
Main namespace for SymEngine package.