aboutsummaryrefslogtreecommitdiff
path: root/backend/Exception.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/Exception.cpp')
-rw-r--r--backend/Exception.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/backend/Exception.cpp b/backend/Exception.cpp
new file mode 100644
index 0000000..4044d6a
--- /dev/null
+++ b/backend/Exception.cpp
@@ -0,0 +1,22 @@
+#include <cstdarg>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+
+#include "backend/String.h"
+
+#include "Exception.h"
+
+using namespace std;
+
+const char * Exception::what() {
+ return this->error.c_str();
+}
+
+Exception::Exception(const char * fmt, ...) {
+ va_list args;
+ va_start(args, fmt);
+ this->error = String::va_fmt(args, fmt);
+ va_end(args);
+}
+