aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/Exception.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-11-07 18:57:04 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-11-07 18:57:04 +0100
commit9df087ede0b539ecbd2778236c7d1143362b384d (patch)
tree01a1c0c46da3a09137fcb9ca6e613fd1148f4df1 /src/crepe/Exception.h
parente36ea050972fcaaf3d85d672755bad4ebb2dcd80 (diff)
check code standard
Diffstat (limited to 'src/crepe/Exception.h')
-rw-r--r--src/crepe/Exception.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/crepe/Exception.h b/src/crepe/Exception.h
new file mode 100644
index 0000000..e4a7bb8
--- /dev/null
+++ b/src/crepe/Exception.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <exception>
+#include <string>
+
+namespace crepe {
+
+//! Exception class with printf-style constructor
+class Exception : public std::exception {
+public:
+ //! printf
+ Exception(const char * fmt, ...);
+ //! Get formatted error message
+ const char * what();
+
+protected:
+ Exception() = default;
+ //! Formatted error message
+ std::string error;
+
+};
+
+}