aboutsummaryrefslogtreecommitdiff
path: root/include/cru/common/Exception.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/common/Exception.hpp')
-rw-r--r--include/cru/common/Exception.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/cru/common/Exception.hpp b/include/cru/common/Exception.hpp
index 4e5d3a16..e8395178 100644
--- a/include/cru/common/Exception.hpp
+++ b/include/cru/common/Exception.hpp
@@ -2,21 +2,24 @@
#include "String.hpp"
namespace cru {
-class CRU_BASE_API Exception {
+class CRU_BASE_API Exception : public std::exception {
public:
- Exception() = default;
- explicit Exception(String message) : message_(std::move(message)) {}
+ Exception();
+ explicit Exception(String message);
CRU_DEFAULT_COPY(Exception)
CRU_DEFAULT_MOVE(Exception)
- virtual ~Exception() = default;
+ ~Exception() override;
public:
String GetMessage() const { return message_; }
+ const char* what() const noexcept override;
+
private:
String message_;
+ mutable std::string utf8_message_;
};
class CRU_BASE_API TextEncodeException : public Exception {