29 #include "../my_config.h"
54 Egeneric(
const std::string &source,
const std::string &message);
59 virtual void stack(
const std::string & passage,
const std::string & message =
"") { pile.push_back(niveau(passage, message)); };
67 const std::string &
get_message()
const {
return pile.front().objet; };
70 const std::string &
get_source()
const {
return pile.front().lieu; };
76 const std::string &
find_object(
const std::string & location)
const;
85 virtual std::string exceptionID()
const = 0;
90 niveau(
const std::string &ou,
const std::string &quoi) { lieu = ou; objet = quoi; };
91 std::string lieu, objet;
94 std::list<niveau> pile;
96 static const std::string empty_string;
110 Ememory(
const std::string &source,
const std::string & message) :
Egeneric(source, message) {};
111 std::string exceptionID()
const {
return "MEMORY"; };
122 std::string exceptionID()
const {
return "SECU_MEMORY"; };
126 #define SRC_BUG Ebug(__FILE__, __LINE__)
133 Ebug(
const std::string &
file, S_I line);
135 void stack(
const std::string & passage,
const std::string & file,
const std::string & line);
138 std::string exceptionID()
const {
return "BUG"; };
148 Einfinint(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
151 std::string exceptionID()
const {
return "INFININT"; };
161 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")) {};
164 std::string exceptionID()
const {
return "LIMITINT"; };
174 Erange(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
177 std::string exceptionID()
const {
return "RANGE"; };
188 Edeci(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
191 std::string exceptionID()
const {
return "DECI"; };
204 std::string exceptionID()
const {
return "UNIMPLEMENTED FEATURE"; };
214 Ehardware(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
217 std::string exceptionID()
const {
return "HARDWARE ERROR"; };
230 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
244 std::string exceptionID()
const {
return "ERROR IN TREATED DATA"; };
254 Escript(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
257 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
267 Elibcall(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
270 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
283 std::string exceptionID()
const {
return "FEATURE DISABLED AT COMPILATION TIME"; };
292 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; };
294 bool immediate_cancel()
const {
return immediate; };
295 U_64 get_flag()
const {
return flag; };
298 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