General exception
| 20 | |
| 21 | /// General exception |
| 22 | class DException : public std::exception { |
| 23 | public: |
| 24 | /** |
| 25 | * Creates an exception with a general error message |
| 26 | */ |
| 27 | DException(void) throw() : m_message("DUtils exception") {} |
| 28 | |
| 29 | /** |
| 30 | * Creates an exception with a custom error message |
| 31 | * @param msg: message |
| 32 | */ |
| 33 | DException(const char* msg) throw() : m_message(msg) {} |
| 34 | |
| 35 | /** |
| 36 | * Creates an exception with a custom error message |
| 37 | * @param msg: message |
| 38 | */ |
| 39 | DException(const std::string& msg) throw() : m_message(msg) {} |
| 40 | |
| 41 | /** |
| 42 | * Destructor |
| 43 | */ |
| 44 | virtual ~DException(void) throw() {} |
| 45 | |
| 46 | /** |
| 47 | * Returns the exception message |
| 48 | */ |
| 49 | virtual const char* what() const throw() { return m_message.c_str(); } |
| 50 | |
| 51 | protected: |
| 52 | /// Error message |
| 53 | std::string m_message; |
| 54 | }; |
| 55 | |
| 56 | } // namespace DUtils |
| 57 |
nothing calls this directly
no outgoing calls
no test coverage detected