29 #include "../my_config.h" 56 Egeneric(
const std::string &source,
const std::string &message);
61 virtual void stack(
const std::string & passage,
const std::string & message =
"") { pile.push_back(niveau(passage, message)); };
69 const std::string &
get_message()
const {
return pile.front().objet; };
72 const std::string &
get_source()
const {
return pile.front().lieu; };
78 const std::string &
find_object(
const std::string & location)
const;
92 virtual std::string exceptionID()
const = 0;
97 niveau(
const std::string &ou,
const std::string &quoi) { lieu = ou; objet = quoi; };
98 std::string lieu, objet;
101 std::list<niveau> pile;
103 static const std::string empty_string;
117 Ememory(
const std::string &source,
const std::string & message) :
Egeneric(source, message) {};
118 std::string exceptionID()
const {
return "MEMORY"; };
129 std::string exceptionID()
const {
return "SECU_MEMORY"; };
133 #define SRC_BUG Ebug(__FILE__, __LINE__) 140 Ebug(
const std::string & file, S_I line);
143 void stack(
const std::string & passage,
const std::string & file,
const std::string & line);
146 std::string exceptionID()
const {
return "BUG"; };
156 Einfinint(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
159 std::string exceptionID()
const {
return "INFININT"; };
169 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")) {};
172 std::string exceptionID()
const {
return "LIMITINT"; };
182 Erange(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
185 std::string exceptionID()
const {
return "RANGE"; };
196 Edeci(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
199 std::string exceptionID()
const {
return "DECI"; };
212 std::string exceptionID()
const {
return "UNIMPLEMENTED FEATURE"; };
222 Ehardware(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
225 std::string exceptionID()
const {
return "HARDWARE ERROR"; };
238 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
252 std::string exceptionID()
const {
return "ERROR IN TREATED DATA"; };
262 Escript(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
265 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
275 Elibcall(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
278 std::string exceptionID()
const {
return "USER ABORTED OPERATION"; };
291 std::string exceptionID()
const {
return "FEATURE DISABLED AT COMPILATION TIME"; };
300 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; };
302 bool immediate_cancel()
const {
return immediate; };
303 U_64 get_flag()
const {
return flag; };
306 std::string exceptionID()
const {
return "THREAD CANCELLATION REQUESTED, ABORTING"; };
325 Esystem(
const std::string & source,
const std::string & message, io_error code);
327 io_error get_code()
const {
return x_code; };
330 virtual std::string exceptionID()
const {
return "SYSTEM ERROR MET"; };
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
exception used to carry system error
const std::string & get_message() const
get the message explaing the nature of the exception
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 ...
std::string dump_str() const
return a string result of the exception information dump
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
const std::string & find_object(const std::string &location) const
retrieve the objet (object) associated to a given "lieu" (location) from the stack ...
const std::string & get_source() const
get the call function which has thrown this exception
exception used to signal convertion problem between infinint and string (decimal representation) ...
contains all the excetion class thrown by libdar
exception used to signal range error
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