80# ifndef ALEPH_EXCEPTIONS_H
81# define ALEPH_EXCEPTIONS_H
103 const std::string
type =
"No defined";
104 const std::string
msg =
"No defined";
115 const std::string &
type,
116 const std::string &
msg)
118 std::ostringstream s;
131 const std::string &
type,
132 const std::string &
msg)
145# define DEFINE_ALEPH_EXCEPTION(name, category_msg) \
146 struct name : public AlephException \
148 name(const size_t line_number, \
149 const std::string & file_name, \
150 const std::string & type, \
151 const std::string & msg) \
152 : AlephException(#category_msg, line_number, file_name, type, msg) {} \
162# define ALEPHTHROW(type, msg) throw type(__LINE__, __FILE__, #type, msg)
165 "minimum value is greater than maximum value");
174 "Please send a bug report to leandro.r.leon@gmail.com");
General utility functions and helpers.
#define DEFINE_ALEPH_EXCEPTION(name, category_msg)
Define a new exception.
static std::string make_what(const std::string &category_msg, size_t line_number, const std::string &file_name, const std::string &type, const std::string &msg)
std::string category_msg
Message describing the error.
const std::string msg
Type name.
const std::string file_name
file name where the exception was thrown
const size_t line_number
Line number of source file where the exception was thrown.
AlephException(const std::string &category_msg, const size_t line_number, const std::string &file_name, const std::string &type, const std::string &msg)