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