Chaste
Release::3.4
|
#include <Exception.hpp>
Public Member Functions | |
Exception (const std::string &rMessage, const std::string &rFilename, unsigned lineNumber) | |
std::string | GetMessage () const |
std::string | GetShortMessage () const |
std::string | CheckShortMessage (std::string expected) const |
std::string | CheckShortMessageContains (std::string expected) const |
Static Public Member Functions | |
static void | Terminate (const std::string &rMessage, const std::string &rFilename, unsigned lineNumber) |
Protected Member Functions | |
void | SetMessage (const std::string &rMessage, const std::string &rFilename, unsigned lineNumber) |
Private Attributes | |
std::string | mMessage |
std::string | mShortMessage |
Exception class. All exceptions thrown by this code are currently instances of this class.
Definition at line 63 of file Exception.hpp.
Exception::Exception | ( | const std::string & | rMessage, |
const std::string & | rFilename, | ||
unsigned | lineNumber | ||
) |
Construct an exception with a message string.
rMessage | the message |
rFilename | which source file threw the exception |
lineNumber | which line number of the source file threw the exception |
Definition at line 52 of file Exception.cpp.
References SetMessage().
std::string Exception::CheckShortMessage | ( | std::string | expected | ) | const |
Helper method for checking we have the right exception.
expected | the expected value of mShortMessage |
Definition at line 97 of file Exception.cpp.
References mShortMessage.
std::string Exception::CheckShortMessageContains | ( | std::string | expected | ) | const |
Helper method for checking we have the right exception.
expected | some expected substring of mShortMessage |
Definition at line 107 of file Exception.cpp.
References mShortMessage.
Referenced by CardiacSimulation::ReadParametersFromFile().
std::string Exception::GetMessage | ( | ) | const |
Get the message associated with the exception with file and line number
Definition at line 87 of file Exception.cpp.
References mMessage.
Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), and CellMLToSharedLibraryConverter::ConvertCellmlToSo().
std::string Exception::GetShortMessage | ( | ) | const |
Get the message associated with the exception
Definition at line 92 of file Exception.cpp.
References mShortMessage.
Referenced by PropagationPropertiesCalculator::CalculateAllActionPotentialDurationsForNodeRange(), and AbstractCardiacProblem< ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM >::Initialise().
|
protected |
Allow subclasses to reset the exception message after construction of the base class, if desired.
rMessage | the message |
rFilename | which source file threw the exception |
lineNumber | which line number of the source file threw the exception |
Definition at line 65 of file Exception.cpp.
References ChasteSourceRootDir(), mMessage, mShortMessage, and ChastePosixPathFixer::ToPosix().
Referenced by Exception().
|
static |
Level 4 error (Termination). Execution cannot continue from this point and hence should be terminated (even when running with NDEBUG or in parallel).
rMessage | An error message to appear on the screen |
rFilename | which source file produced the termination error |
lineNumber | which line number of the source file produced the termination error |
Definition at line 118 of file Exception.cpp.
|
private |
Full exception message - includes file and line number.
Definition at line 134 of file Exception.hpp.
Referenced by GetMessage(), and SetMessage().
|
private |
Short exception message - just text of the exception.
Definition at line 135 of file Exception.hpp.
Referenced by CheckShortMessage(), CheckShortMessageContains(), GetShortMessage(), and SetMessage().