9 #ifndef CT_CTEXCEPTIONS_H
10 #define CT_CTEXCEPTIONS_H
111 CanteraError(
const std::string& procedure,
const std::string& msg);
117 const char*
what()
const throw();
127 return "CanteraError";
172 return "ArraySizeError";
198 IndexError(
const std::string& func,
const std::string& arrayName,
size_t m,
size_t mmax) :
199 CanteraError(func), arrayName_(arrayName), m_(m), mmax_(mmax) {}
208 std::string arrayName_;
220 return "NotImplementedError";
236 #define XSTR_TRACE_LINE(s) STR_TRACE_LINE(s)
239 #define STR_TRACE_LINE(s) #s
245 #define STR_TRACE (std::string(__FILE__) + ":" + XSTR_TRACE_LINE(__LINE__))
249 # define AssertTrace(expr) ((void) (0))
252 # define AssertThrow(expr, procedure) ((void) (0))
254 #ifndef AssertThrowMsg
255 # define AssertThrowMsg(expr,procedure, message) ((void) (0))
270 # define AssertTrace(expr) ((expr) ? (void) 0 : throw Cantera::CanteraError(STR_TRACE, std::string("failed assert: ") + #expr))
283 # define AssertThrow(expr, procedure) ((expr) ? (void) 0 : throw Cantera::CanteraError(procedure, std::string("failed assert: ") + #expr))
300 #ifndef AssertThrowMsg
301 # define AssertThrowMsg(expr, procedure, message) ((expr) ? (void) 0 : throw Cantera::CanteraError(procedure + std::string(": at failed assert: \"") + std::string(#expr) + std::string("\""), message))
308 # define AssertFinite(expr, procedure, message) AssertThrowMsg(expr < BigNumber && expr > -BigNumber, procedure, message)
IndexError(const std::string &func, const std::string &arrayName, size_t m, size_t mmax)
Constructor.
std::string formattedMessage_
Formatted message returned by what()
bool saved_
Exception has already been saved to Cantera's error stack.
An error indicating that an unimplemented function has been called.
For this specification of range behavior, the overflow or underflow calculation is changed...
std::string msg_
Message associated with the exception.
When an overflow or underflow occurs, Cantera will throw an error.
CT_RealNumber_Range_Behavior
Enum containing Cantera's behavior for situations where overflow or underflow of real variables may o...
virtual std::string getClass() const
Method overridden by derived classes to indicate their type.
virtual std::string getClass() const
Method overridden by derived classes to indicate their type.
virtual std::string getMessage() const
Method overridden by derived classes to format the error message.
const char * what() const
Get a description of the error.
std::string procedure_
The name of the procedure where the exception occurred.
bool check_FENV_OverUnder_Flow()
Quick check on whether there has been an underflow or overflow condition in the floating point unit...
Base class for exceptions thrown by Cantera classes.
virtual std::string getMessage() const
Method overridden by derived classes to format the error message.
CanteraError()
Protected default constructor discourages throwing errors containing no information.
void clear_FENV()
Clear all the flags for floating-point exceptions.
virtual std::string getClass() const
Method overridden by derived classes to indicate their type.
virtual std::string getMessage() const
Method overridden by derived classes to format the error message.
ArraySizeError(const std::string &procedure, size_t sz, size_t reqd)
Constructor.
virtual std::string getClass() const
Method overridden by derived classes to indicate their type.
For this specification of range behavior, nothing is done.
An array index is out of range.
Cantera will throw an error in debug mode but will not in production mode.
Cantera will use the fenv check capability introduced in C99 to check for overflow and underflow cond...
void save()
Function to put this error onto Cantera's error stack.
virtual ~CanteraError()
Destructor for base class does nothing.