29 #include "../my_config.h"
55 Egeneric(
const std::string &source,
const std::string &message);
60 virtual void stack(
const std::string & passage,
const std::string & message =
"") { pile.push_back(niveau(passage, message)); };
68 const std::string &
get_message()
const {
return pile.front().objet; };
71 const std::string &
get_source()
const {
return pile.front().lieu; };
77 const std::string &
find_object(
const std::string & location)
const;
86 virtual std::string exceptionID()
const = 0;
91 niveau(
const std::string &ou,
const std::string &quoi) { lieu = ou; objet = quoi; };
92 std::string lieu, objet;
95 std::list<niveau> pile;
97 static const std::string empty_string;
111 Ememory(
const std::string &source,
const std::string & message) :
Egeneric(source, message) {};
112 std::string exceptionID()
const {
return "MEMORY"; };
123 std::string exceptionID()
const {
return "SECU_MEMORY"; };
127 #define SRC_BUG Ebug(__FILE__, __LINE__)
134 Ebug(
const std::string &
file, S_I line);
137 void stack(
const std::string & passage,
const std::string & file,
const std::string & line);
140 std::string exceptionID()
const {
return "BUG"; };
150 Einfinint(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
153 std::string exceptionID()
const {
return "INFININT"; };
163 Elimitint() :
Egeneric(
"",
dar_gettext(
"Cannot handle such a too large integer. Use a full version of libdar (compiled to rely on the \"infinint\" integer type) to solve this problem")) {};
166 std::string exceptionID()
const {
return "LIMITINT"; };
176 Erange(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
179 std::string exceptionID()
const {
return "RANGE"; };
190 Edeci(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
193 std::string exceptionID()
const {
return "DECI"; };
206 std::string exceptionID()
const {
return "UNIMPLEMENTED FEATURE"; };
216 Ehardware(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
219 std::string exceptionID()
const {
return "HARDWARE ERROR"; };
232 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
246 std::string exceptionID()
const {
return "ERROR IN TREATED DATA"; };
256 Escript(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
259 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
269 Elibcall(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
272 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
285 std::string exceptionID()
const {
return "FEATURE DISABLED AT COMPILATION TIME"; };
294 Ethread_cancel(
bool now, U_64 x_flag) :
Egeneric(
"", now ?
dar_gettext(
"Thread cancellation requested, aborting as soon as possible") :
dar_gettext(
"Thread cancellation requested, aborting as properly as possible")) { immediate = now; flag = x_flag; };
296 bool immediate_cancel()
const {
return immediate; };
297 U_64 get_flag()
const {
return flag; };
300 std::string exceptionID()
const {
return "THREAD CANCELLATION REQUESTED, ABORTING"; };
exception used to signal an error in the argument given to libdar call of the API ...
virtual ~Egeneric()
the destructor
are defined here basic integer types that tend to be portable
const std::string & find_object(const std::string &location) const
retrieve the objet (object) associated to a given "lieu" (location) from the stack ...
void dump() const
dump all information of the exception to the standard error
Egeneric(const std::string &source, const std::string &message)
the constructor
const char * dar_gettext(const char *)
a routine to change NLS domaine forth and back for inline routines
exception used when hardware problem is found
exception used when a requested fearture has not beed activated at compilation time ...
this is the parent class of all exception classes.
exception used when a limitint overflow is detected, the maximum value of the limitint has been excee...
virtual void stack(const std::string &passage, const std::string &message="")
add more detailed couple of information to the exception
exception used when an error concerning the treated data has been met
exception used when secure memory has been exhausted
exception used when the thread libdar is running in is asked to stop
exception used when memory has been exhausted
exception used when a requested feature is not (yet) implemented
exception used when arithmetic error is detected when operating on infinint
exception used to signal convertion problem between infinint and string (decimal representation) ...
const std::string & get_message() const
get the message explaing the nature of the exception
exception used to signal range error
const std::string & get_source() const
get the call function which has thrown this exception
exception used to signal a bug. A bug is triggered when reaching some code that should never be reach...
void prepend_message(const std::string &context)
prepend error message by the given string
exception used to signal that the user has aborted the operation
exception used when error the inter-slice user command returned an error code
libdar namespace encapsulate all libdar symbols