1 #pragma once 2 3 #include <exception> 4 #include <string> 5 6 class ToolException : public std::exception 7 { 8 public: 9 explicit ToolException(const std::string& message) : message(message){}; 10 11 virtual const char* what() const noexcept override 12 { 13 return message.c_str(); 14 } 15 16 private: 17 std::string message; 18 }; 19