1 #ifndef __DIADES__UTILS__EXCEPTION__HH 2 #define __DIADES__UTILS__EXCEPTION__HH 20 template<
typename Object>
27 Exception(
const string & whatArg):exception(),_what(Object::typeName() +
" exception: \"" + whatArg +
"\""){}
28 Exception(
const Msg & msg):exception(),_what(Object::typeName() +
" exception: \"" + msg.str() +
"\""){}
29 Exception(
const string & whatArg,
const exception & e):
30 exception(),_what(Object::typeName() +
" exception: \"" + whatArg +
"\"")
32 _what +=
" due to \n";
36 exception(),_what(Object::typeName() +
" exception: \"" + msg.str() +
"\"")
38 _what +=
" due to \n";
41 virtual const char *
what()
const throw()
57 FunctionException(
const string & whatArg):exception(),_what(
"A function exception has been thrown: \"" + whatArg +
"\""){}
58 FunctionException(
const Msg & msg):exception(),_what(
"A function exception has been thrown: \"" + msg.str() +
"\""){}
60 FunctionException(
const string & functionName,
const string & whatArg):exception(),_what(
"Function " + functionName +
" throws the exception:\"" + whatArg +
"\""){}
62 FunctionException(
const string & functionName,
const string & whatArg,
const exception & e):exception(),_what(
"Function " + functionName +
" throws the exception:\"" + whatArg +
"\""){
63 _what +=
" due to \n";
66 FunctionException(
const string & functionName,
const Msg & whatArg,
const exception & e):exception(),_what(
"Function " + functionName +
" throws the exception:\"" + whatArg.str() +
"\""){
67 _what +=
" due to \n";
71 FunctionException(
const string & functionName,
const Msg & whatArg):exception(),_what(
"Function " + functionName +
" throws the exception:\"" + whatArg.str() +
"\""){}
73 virtual const char *
what()
const throw()
91 Failure(
const string & functionName):exception(),_what(
"Function " + functionName +
" throws a failure exception."){}
96 const exception & e):exception(),
97 _what(
"Function " + functionName +
" throws a failure exception"){
98 _what +=
" due to \n";
103 virtual const char *
what()
const throw()
105 return _what.c_str();
virtual const char * what() const
Failure(const string &functionName, const exception &e)
FunctionException(const string &whatArg)
virtual const char * what() const
FunctionException(const string &functionName, const Msg &whatArg, const exception &e)
Failure(const string &functionName)
FunctionException(const Msg &msg)
Exception(const string &whatArg, const exception &e)
FunctionException(const string &functionName, const Msg &whatArg)
Namespace of the Diades project.
virtual ~FunctionException()
Exception(const Msg &msg, const exception &e)
Exception(const string &whatArg)
FunctionException(const string &functionName, const string &whatArg)
Exception(const Msg &msg)
FunctionException(const string &functionName, const string &whatArg, const exception &e)
virtual const char * what() const