| 4 | #include <exception> |
| 5 | |
| 6 | class DukException : public std::exception |
| 7 | { |
| 8 | public: |
| 9 | virtual const char* what() const noexcept override |
| 10 | { |
| 11 | return mMsg.c_str(); |
| 12 | } |
| 13 | |
| 14 | template <typename T> |
| 15 | DukException& operator<<(T rhs) |
| 16 | { |
| 17 | std::stringstream ss; |
| 18 | ss << mMsg << rhs; |
| 19 | mMsg = ss.str(); |
| 20 | return *this; |
| 21 | } |
| 22 | |
| 23 | protected: |
| 24 | std::string mMsg; |
| 25 | }; |
| 26 | |
| 27 | class DukErrorException : public DukException |
| 28 | { |
no outgoing calls
no test coverage detected