Flow123d
release_3.0.0-688-g6b683cf
|
Base of exceptions used in Flow123d. More...
#include <exceptions.hh>
Public Member Functions | |
ExceptionBase () | |
Default constructor, just calls fill_stacktrace() . More... | |
ExceptionBase (const ExceptionBase &other) | |
Copy constructor, performs deep copy of stacktrace. More... | |
void | print_stacktrace (std::ostream &out) const |
Prints formated stacktrace into given stream out . More... | |
virtual void | print_info (std::ostringstream &out) const =0 |
const char * | what () const throw () |
virtual | ~ExceptionBase () throw () |
Destructor, possibly free stacktrace. More... | |
Protected Member Functions | |
virtual std::string | what_type_msg () const |
Return type of message ("Program error" for this class). Can be override in descendants. More... | |
virtual std::ostringstream & | form_message (std::ostringstream &) const |
Protected Attributes | |
StackTrace | stack_trace_ |
Stacktrace of exception. More... | |
std::vector< std::string > | frames_to_cut_ |
Stacktrace frames, which will be cut, see StackTrace::print method. More... | |
Base of exceptions used in Flow123d.
We use boost::exception as parent in order to allow passing some data through the exception object from the throw point to the catch point. See DECLARE_EXCEPTION macro for usage.
When deriving particular exceptions always use virtual inheritance:
Definition at line 75 of file exceptions.hh.
ExceptionBase::ExceptionBase | ( | ) |
Default constructor, just calls fill_stacktrace()
.
Definition at line 25 of file exceptions.cc.
ExceptionBase::ExceptionBase | ( | const ExceptionBase & | other | ) |
Copy constructor, performs deep copy of stacktrace.
Definition at line 31 of file exceptions.cc.
|
virtual |
Destructor, possibly free stacktrace.
Definition at line 37 of file exceptions.cc.
|
protectedvirtual |
Method for output the exception message. Implements composition of complex message including diagnostic informations and stack trace.
Reimplemented in feal::Exc_assert, and Input::Exception.
Definition at line 101 of file exceptions.cc.
|
pure virtual |
Purely virtual method, that should be implemented by descendants. Prints specific error message into stream out
. In particular you can use macros DECLARE_EXCEPTION or DECLARE_INPUT_EXCEPTION for easy declarations.
Implemented in feal::Exc_assert, and ExcArmadillo.
void ExceptionBase::print_stacktrace | ( | std::ostream & | out | ) | const |
Prints formated stacktrace into given stream out
.
Definition at line 42 of file exceptions.cc.
const char * ExceptionBase::what | ( | ) | const | |
throw | ( | |||
) |
Overloaded method for output the exception message if it is not catched. Creates envelope of form_message
method. Should not be overloded in descendant classes. Use form_message
instead.
Definition at line 47 of file exceptions.cc.
|
protectedvirtual |
Return type of message ("Program error" for this class). Can be override in descendants.
Reimplemented in feal::Exc_assert.
Definition at line 96 of file exceptions.cc.
|
protected |
Stacktrace frames, which will be cut, see StackTrace::print
method.
Definition at line 109 of file exceptions.hh.
|
protected |
Stacktrace of exception.
Definition at line 107 of file exceptions.hh.