Cantera
2.0
|
Base class for exceptions thrown by Cantera classes. More...
#include <ctexceptions.h>
Public Member Functions | |
CanteraError (std::string procedure, std::string msg) | |
Normal Constructor for the CanteraError base class. | |
virtual | ~CanteraError () throw () |
Destructor for base class does nothing. | |
const char * | what () const throw () |
Get a description of the error. | |
void | save () |
Function to put this error onto Cantera's error stack. | |
virtual std::string | getMessage () const |
Method overridden by derived classes to formatted the error message. | |
virtual std::string | getClass () const |
Method overridden by derived classes to indicate their type. | |
Protected Member Functions | |
CanteraError () | |
Protected default constructor discourages throwing errors containing no information. | |
CanteraError (std::string procedure) | |
Constructor used by derived classes that override getMessage() | |
Protected Attributes | |
std::string | procedure_ |
The name of the procedure where the exception occurred. | |
Private Attributes | |
std::string | msg_ |
Message associated with the exception. | |
std::string | formattedMessage_ |
Formatted message returned by what() | |
bool | saved_ |
Exception has already been saved to Cantera's error stack. | |
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 70 of file ctexceptions.h.
CanteraError | ( | std::string | procedure, |
std::string | msg | ||
) |
Normal Constructor for the CanteraError base class.
In the constructor, a call to the Application class is made to store the strings associated with the generated error condition.
procedure | String name for the function within which the error was generated. |
msg | Descriptive string describing the type of error message. |
Definition at line 16 of file ctexceptions.cpp.
References CanteraError::save().
|
inlinevirtual |
Destructor for base class does nothing.
Definition at line 85 of file ctexceptions.h.
|
inlineprotected |
Protected default constructor discourages throwing errors containing no information.
Definition at line 101 of file ctexceptions.h.
Referenced by UnknownVPSSMgr::UnknownVPSSMgr().
|
protected |
Constructor used by derived classes that override getMessage()
Definition at line 25 of file ctexceptions.cpp.
References CanteraError::save().
const char * what | ( | ) | const throw () |
Get a description of the error.
Definition at line 41 of file ctexceptions.cpp.
References CanteraError::formattedMessage_, CanteraError::getClass(), CanteraError::getMessage(), and CanteraError::procedure_.
Referenced by TransportFactory::getLiquidInteractionsTransportData().
void save | ( | ) |
Function to put this error onto Cantera's error stack.
Definition at line 33 of file ctexceptions.cpp.
References Application::addError(), CanteraError::getMessage(), Application::Instance(), CanteraError::procedure_, and CanteraError::saved_.
Referenced by CanteraError::CanteraError(), Cantera::equilibrate(), ChemEquil::equilibrate(), MultiPhase::equilibrate(), ChemEquil::estimateEP_Brinkley(), TransportFactory::getLiquidSpeciesTransportData(), TransportFactory::getTransportData(), PseudoBinaryVPSSTP::report(), MolarityIonicVPSSTP::report(), PureFluidPhase::report(), MolalityVPSSTP::report(), ThermoPhase::report(), PureFluidPhase::reportCSV(), MolalityVPSSTP::reportCSV(), ThermoPhase::reportCSV(), ChemEquil::setInitialMoles(), ThermoPhase::setState_TPX(), ThermoPhase::setState_TPY(), MultiTransport::solveLMatrixEquation(), Cantera::vcs_equilibrate(), and Cantera::vcs_equilibrate_1().
|
virtual |
Method overridden by derived classes to formatted the error message.
Reimplemented in IndexError, and ArraySizeError.
Definition at line 56 of file ctexceptions.cpp.
References CanteraError::msg_.
Referenced by CanteraError::save(), and CanteraError::what().
|
inlinevirtual |
Method overridden by derived classes to indicate their type.
Reimplemented in IndexError, and ArraySizeError.
Definition at line 97 of file ctexceptions.h.
Referenced by CanteraError::what().
|
protected |
The name of the procedure where the exception occurred.
Definition at line 107 of file ctexceptions.h.
Referenced by CanteraError::save(), and CanteraError::what().
|
private |
Message associated with the exception.
Definition at line 110 of file ctexceptions.h.
Referenced by CanteraError::getMessage().
|
mutableprivate |
Formatted message returned by what()
Definition at line 111 of file ctexceptions.h.
Referenced by CanteraError::what().
|
private |
Exception has already been saved to Cantera's error stack.
Definition at line 112 of file ctexceptions.h.
Referenced by CanteraError::save().