diff options
Diffstat (limited to 'src/crepe/Exception.h')
-rw-r--r-- | src/crepe/Exception.h | 23 |
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; + +}; + +} |