aboutsummaryrefslogtreecommitdiff
path: root/src/common/Exception.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/Exception.cpp')
-rw-r--r--src/common/Exception.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/Exception.cpp b/src/common/Exception.cpp
new file mode 100644
index 00000000..779c65d6
--- /dev/null
+++ b/src/common/Exception.cpp
@@ -0,0 +1,17 @@
+#include "cru/common/Exception.hpp"
+
+namespace cru {
+Exception::Exception() {}
+
+Exception::Exception(String message) : message_(std::move(message)) {}
+
+Exception::~Exception() {}
+
+const char* Exception::what() const noexcept {
+ if (!message_.empty() && utf8_message_.empty()) {
+ utf8_message_ = message_.ToUtf8();
+ }
+
+ return utf8_message_.c_str();
+}
+} // namespace cru