B15F Board 15 Famulus Edition

driverexception.h
1 #ifndef DRIVEREXCEPTION_H
2 #define DRIVEREXCEPTION_H
3
4 #include <exception>
5
6 // SOURCE: https://stackoverflow.com/a/8152888
7
10 class DriverException: public std::exception
11 {
12 public:
13 explicit DriverException(const char* message) : msg_(message)
14 {
15 }
16
17 explicit DriverException(const std::string& message) : msg_(message)
18 {
19 }
20
21 virtual ~DriverException() throw ()
22 {
23 }
24
25 virtual const char* what() const throw ()
26 {
27 return msg_.c_str();
28 }
29
30 protected:
31 std::string msg_;
32 };
33
34 #endif // DRIVEREXCEPTION_H
35
DriverException
Definition: driverexception.h:10