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 
9 class USARTException: public std::exception
10 {
11 public:
12  explicit USARTException(const char* message) : msg(message)
13  {
14  }
15 
16  explicit USARTException(const std::string& message) : msg(message)
17  {
18  }
19 
20  virtual ~USARTException() throw ()
21  {
22  }
23 
24  virtual const char* what() const throw ()
25  {
26  return msg.c_str();
27  }
28 
29 protected:
30  std::string msg;
31 };
32 
33 #endif // USARTEXCEPTION_H
USARTException
Definition: usartexception.h:9