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