diff options
author | crupest <crupest@outlook.com> | 2022-01-15 22:41:11 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-01-15 22:41:11 +0800 |
commit | 570e95f4551385a81eb2cf6f2e386e3b0cb291a8 (patch) | |
tree | 8ed08ab29f49b260ac66e88a75aa436c4daefb57 /include/cru/common/Exception.hpp | |
parent | abb9d48a72e2d580d6bfbfcb600795c5ec66e204 (diff) | |
download | cru-570e95f4551385a81eb2cf6f2e386e3b0cb291a8.tar.gz cru-570e95f4551385a81eb2cf6f2e386e3b0cb291a8.tar.bz2 cru-570e95f4551385a81eb2cf6f2e386e3b0cb291a8.zip |
...
Diffstat (limited to 'include/cru/common/Exception.hpp')
-rw-r--r-- | include/cru/common/Exception.hpp | 11 |
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 { |