#include <exceptions.hh>
Public Member Functions | |
| ExceptionBase () throw () | |
| Default constructor. | |
| ExceptionBase (const std::string &message) throw () | |
| ExceptionBase (const std::string &file, const unsigned int line, const std::string &function, const std::string &excName) throw () | |
| void | setFields (const std::string &file, const unsigned int line, const std::string &function, const std::string &excName) throw () |
Protected Member Functions | |
| virtual std::ostream & | info (std::ostream &os) const throw () |
| Returns information in an output stream. | |
Protected Attributes | |
| std::string | file_ |
| Filename where the exception was thrown from. | |
| unsigned int | line_ |
| Line where the exception was thrown from. | |
| std::string | function_ |
| Name of the function that threw the exception. | |
| std::string | excName_ |
| The name of the exception with calling sequence. | |
Base class for exceptions. This class features informations about the exceptions thrown, ie. filename and line, name of the function and of the exception. The ouput operator (<<) can display this information.
The typical usage of this class is to throw an exception if an error has occured. This can be done by
throw conceptsException(ExceptionBase());
These exceptions are always present (in a production code as well as in development code). If you want to have assertions using exceptions (which are only in the development code), have a look at Assertion and conceptsAssert.
There are two different error cases:
conceptsAssert(1 == 0, Assertion());These assertions are not working with the optimised version of the library
throw conceptsException(ExceptionBase());
Definition at line 84 of file exceptions.hh.
|
inline | ||||||||||||||
Definition at line 91 of file exceptions.hh.
| concepts::ExceptionBase::ExceptionBase | ( | const std::string & | file, |
| const unsigned int | line, | ||
| const std::string & | function, | ||
| const std::string & | excName | ||
| ) | |||
| throw | ( | ||
| ) | |||
Constructor.
| file | Filename where the exception was thrown from |
| line | Line where the exception was thrown from |
| function | Name of the function that threw the exception |
| excName | The name of the exception |
|
protectedvirtual | ||||||||||||||
Returns information in an output stream.
Reimplemented from concepts::OutputOperator.
Reimplemented in concepts::WrongInputException, concepts::MissingFeature, concepts::Assertion, concepts::FileOpenError, concepts::FortranException, concepts::NoConvergence, concepts::NoMPIInit_Error, test::TestSuiteError, concepts::FluxesError, concepts::ImplicitEquilibratedA0Error, concepts::ElementNotInDomainOfFormula, concepts::PointerToEmptyElementFormula, concepts::PointerToEmptyFormula, concepts::FormulaSyntaxError, concepts::NegativeJacobian, concepts::FFEF_Error, concepts::Ez4uException, concepts::GmshInputException, concepts::StrategyChange, concepts::MatfileIOError, concepts::PointerToEmptyBilinearForm, concepts::MumpsException, concepts::NewtonException, and concepts::MissingParameter.
| void concepts::ExceptionBase::setFields | ( | const std::string & | file, |
| const unsigned int | line, | ||
| const std::string & | function, | ||
| const std::string & | excName | ||
| ) | |||
| throw | ( | ||
| ) | |||
Sets the fields of this exception.
| file | Filename where the exception was thrown from |
| line | Line where the exception was thrown from |
| function | Name of the function that threw the exception |
| excName | The name of the exception |
|
protected |
The name of the exception with calling sequence.
Definition at line 132 of file exceptions.hh.
|
protected |
Filename where the exception was thrown from.
Definition at line 123 of file exceptions.hh.
|
protected |
Name of the function that threw the exception.
Definition at line 129 of file exceptions.hh.
Line where the exception was thrown from.
Definition at line 126 of file exceptions.hh.