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);
136 void stack(
const std::string & passage,
const std::string & file,
const std::string & line);
139 std::string exceptionID()
const {
return "BUG"; };
149 Einfinint(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
152 std::string exceptionID()
const {
return "INFININT"; };
162 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")) {};
165 std::string exceptionID()
const {
return "LIMITINT"; };
175 Erange(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
178 std::string exceptionID()
const {
return "RANGE"; };
189 Edeci(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
192 std::string exceptionID()
const {
return "DECI"; };
205 std::string exceptionID()
const {
return "UNIMPLEMENTED FEATURE"; };
215 Ehardware(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
218 std::string exceptionID()
const {
return "HARDWARE ERROR"; };
231 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
245 std::string exceptionID()
const {
return "ERROR IN TREATED DATA"; };
255 Escript(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
258 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
268 Elibcall(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
271 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
284 std::string exceptionID()
const {
return "FEATURE DISABLED AT COMPILATION TIME"; };
293 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; };
295 bool immediate_cancel()
const {
return immediate; };
296 U_64 get_flag()
const {
return flag; };
299 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