29#include "../my_config.h"
55 Egeneric(
const std::string &source,
const std::string &message);
73 void stack(
const std::string & passage,
const std::string & message =
"") {
pile.push_back(niveau(passage, message)); };
74 void stack(
const std::string && passage,
const std::string && message =
"") {
pile.push_back(niveau(std::move(passage), std::move(message))); };
91 const std::string &
find_object(
const std::string & location)
const;
100 virtual std::string exceptionID()
const = 0;
105 niveau(
const std::string & ou,
const std::string & quoi) { lieu = ou; objet = quoi; };
106 niveau(std::string && ou, std::string && quoi) { lieu = std::move(ou); objet = std::move(quoi); };
107 niveau(
const niveau & ref) =
default;
108 niveau(niveau && ref)
noexcept =
default;
109 niveau &
operator = (
const niveau & ref) =
default;
110 niveau &
operator = (niveau && ref)
noexcept =
default;
113 std::string lieu, objet;
116 std::deque<niveau> pile;
118 static const std::string empty_string;
137 Ememory(
const std::string &source,
const std::string & message) :
Egeneric(source, message) {};
138 virtual std::string exceptionID()
const override {
return "MEMORY"; };
154 virtual std::string exceptionID()
const override {
return "SECU_MEMORY"; };
158#define SRC_BUG Ebug(__FILE__, __LINE__)
165 Ebug(
const std::string & file, S_I line);
168 Ebug & operator = (
const Ebug & ref) =
default;
169 Ebug & operator = (
Ebug && ref) =
default;
173 void stack(
const std::string & passage,
const std::string & file,
const std::string & line);
176 virtual std::string exceptionID()
const override {
return "BUG"; };
186 Einfinint(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
194 virtual std::string exceptionID()
const override {
return "INFININT"; };
204 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")) {};
212 virtual std::string exceptionID()
const override {
return "LIMITINT"; };
222 Erange(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
230 virtual std::string exceptionID()
const override {
return "RANGE"; };
241 Edeci(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
244 Edeci & operator = (
const Edeci & ref) =
default;
249 virtual std::string exceptionID()
const override {
return "DECI"; };
267 virtual std::string exceptionID()
const override {
return "UNIMPLEMENTED FEATURE"; };
277 Ehardware(
const std::string & source,
const std::string & message) :
Egeneric(source, message) {};
285 virtual std::string exceptionID()
const override {
return "HARDWARE ERROR"; };
303 virtual std::string exceptionID()
const override {
return "USER ABORTED OPERATION"; };
317 Edata & operator = (
const Edata & ref) =
default;
322 virtual std::string exceptionID()
const override {
return "ERROR IN TREATED DATA"; };
332 Escript(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
340 virtual std::string exceptionID()
const override {
return "USER ABORTED OPERATION"; };
350 Elibcall(
const std::string & source,
const std::string & msg) :
Egeneric(source ,msg) {};
358 virtual std::string exceptionID()
const override {
return "USER ABORTED OPERATION"; };
376 virtual std::string exceptionID()
const override {
return "FEATURE DISABLED AT COMPILATION TIME"; };
385 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; };
392 bool immediate_cancel()
const {
return immediate; };
393 U_64 get_flag()
const {
return flag; };
396 virtual std::string exceptionID()
const override {
return "THREAD CANCELLATION REQUESTED, ABORTING"; };
416 Esystem(
const std::string & source,
const std::string & message, io_error code);
423 io_error get_code()
const {
return x_code; };
426 virtual std::string exceptionID()
const override {
return "SYSTEM ERROR MET"; };
445 virtual std::string exceptionID()
const override {
return "NETWORK AUTHENTICATION ERROR"; };
exception used to signal a bug. A bug is triggered when reaching some code that should never be reach...
exception used when a requested fearture has not beed activated at compilation time
exception used when an error concerning the treated data has been met
exception used to signal convertion problem between infinint and string (decimal representation)
exception used when a requested feature is not (yet) implemented
this is the parent class of all exception classes.
void stack(const std::string &passage, const std::string &message="")
add more detailed couple of information to the exception
Egeneric(const std::string &source, const std::string &message)
the constructor
Egeneric(Egeneric &&ref)=default
move constructor
virtual ~Egeneric()=default
the destructor
const std::string & get_source() const
get the call function which has thrown this exception
void prepend_message(const std::string &context)
prepend error message by the given string
std::string dump_str() const
return a string result of the exception information dump
Egeneric(const Egeneric &ref)=default
copy constructor
const std::string & get_message() const
get the message explaing the nature of the exception
const std::string & find_object(const std::string &location) const
retrieve the objet (object) associated to a given "lieu" (location) from the stack
Egeneric & operator=(const Egeneric &ref)=default
assignment operator
exception used when hardware problem is found
exception used when arithmetic error is detected when operating on infinint
exception used to signal an error in the argument given to libdar call of the API
exception used when a limitint overflow is detected, the maximum value of the limitint has been excee...
exception used when memory has been exhausted
exception used to report authentication error
exception used to signal range error
exception used when error the inter-slice user command returned an error code
exception used when secure memory has been exhausted
exception used to carry system error
exception used when the thread libdar is running in is asked to stop
exception used to signal that the user has aborted the operation
stores a stack of generic_files writing/reading on each others
const char * dar_gettext(const char *)
a routine to change NLS domaine forth and back for inline routines
are defined here basic integer types that tend to be portable
libdar namespace encapsulate all libdar symbols