|
Cantera 2.6.0
|
Base class for exceptions thrown by Cantera classes. More...
#include <ctexceptions.h>
Public Member Functions | |
| template<typename... Args> | |
| CanteraError (const std::string &procedure, const std::string &msg, const Args &... args) | |
| Normal Constructor for the CanteraError base class. More... | |
| virtual | ~CanteraError () throw () |
| Destructor for base class does nothing. More... | |
| const char * | what () const throw () |
| Get a description of the error. More... | |
| virtual std::string | getMessage () const |
| Method overridden by derived classes to format the error message. More... | |
| virtual std::string | getClass () const |
| Method overridden by derived classes to indicate their type. More... | |
Protected Member Functions | |
| CanteraError () | |
| Protected default constructor discourages throwing errors containing no information. More... | |
| CanteraError (const std::string &procedure) | |
| Constructor used by derived classes that override getMessage() More... | |
Protected Attributes | |
| std::string | procedure_ |
| The name of the procedure where the exception occurred. More... | |
| std::string | formattedMessage_ |
| Formatted message returned by what() More... | |
Private Attributes | |
| std::string | msg_ |
| Message associated with the exception. More... | |
Base class for exceptions thrown by Cantera classes.
This class is the base class for exceptions thrown by Cantera. It inherits from std::exception so that normal error handling operations from applications may automatically handle the errors in their own way.
Definition at line 60 of file ctexceptions.h.
|
inline |
Normal Constructor for the CanteraError base class.
| procedure | Name of the function within which the error was generated. For member functions, this should be written as ClassName::functionName. For constructors, this should be ClassName::ClassName. Arguments can be specified to disambiguate overloaded functions, such as ClassName::functionName(int, int). |
| msg | Descriptive string describing the type of error message. This can be a fmt-style format string (that is, using curly braces to indicate fields), which will be used with additional arguments to generate a formatted error message |
| args | Arguments which will be used to interpolate the format string |
Definition at line 78 of file ctexceptions.h.
References CanteraError::msg_.
|
inlinevirtual | |||||||||||||
Destructor for base class does nothing.
Definition at line 90 of file ctexceptions.h.
|
inlineprotected |
Protected default constructor discourages throwing errors containing no information.
Definition at line 106 of file ctexceptions.h.
|
explicitprotected |
Constructor used by derived classes that override getMessage()
Definition at line 20 of file ctexceptions.cpp.
| const char * what | ( | ) | const | |
| throw | ( | |||
| ) | ||||
Get a description of the error.
Definition at line 25 of file ctexceptions.cpp.
References CanteraError::formattedMessage_, CanteraError::getClass(), CanteraError::getMessage(), and CanteraError::procedure_.
Referenced by FuncEval::eval_nothrow().
|
virtual |
Method overridden by derived classes to format the error message.
Reimplemented in ArraySizeError, IndexError, and XML_Error.
Definition at line 45 of file ctexceptions.cpp.
References CanteraError::msg_.
Referenced by ChemEquil::equilibrate(), and CanteraError::what().
|
inlinevirtual |
Method overridden by derived classes to indicate their type.
Reimplemented in InputFileError, ArraySizeError, IndexError, NotImplementedError, XML_TagMismatch, and XML_NoChild.
Definition at line 99 of file ctexceptions.h.
Referenced by CanteraError::what().
|
protected |
The name of the procedure where the exception occurred.
Definition at line 112 of file ctexceptions.h.
Referenced by CanteraError::what().
|
mutableprotected |
Formatted message returned by what()
Definition at line 113 of file ctexceptions.h.
Referenced by CanteraError::what().
|
private |
Message associated with the exception.
Definition at line 116 of file ctexceptions.h.
Referenced by CanteraError::CanteraError(), and CanteraError::getMessage().