summaryrefslogtreecommitdiff
path: root/cesar/maximus/utils/inc/Error.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/maximus/utils/inc/Error.h')
-rw-r--r--cesar/maximus/utils/inc/Error.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/cesar/maximus/utils/inc/Error.h b/cesar/maximus/utils/inc/Error.h
new file mode 100644
index 0000000000..3754f88d93
--- /dev/null
+++ b/cesar/maximus/utils/inc/Error.h
@@ -0,0 +1,36 @@
+
+#ifndef ERROR_H
+#define ERROR_H
+
+#include <iostream>
+#include <stdexcept>
+#include <errno.h>
+using namespace std;
+
+
+class Error : public runtime_error
+{
+
+public:
+
+ Error ( const string & function, const string & msg, const error_t error = ENOTRECOVERABLE );
+
+ virtual ~Error ( ) throw ( );
+
+ inline string getFunction ( ) const { return mFunction; }
+
+ inline error_t getErrno ( ) const { return mErrorId; }
+
+ inline string getMessage ( ) const { return what(); }
+
+ void display ( ) const;
+
+private:
+
+ error_t mErrorId;
+ string mFunction;
+
+};
+
+
+#endif // ERROR_H