B15F
Board 15 Famulus Edition
usartexception.h
1 #ifndef USARTEXCEPTION_H
2 #define USARTEXCEPTION_H
3 
4 #include <exception>
5 #include <string>
6 
9 class USARTException: public std::exception
10 {
11 public:
16  explicit USARTException(const char* message) : msg(message)
17  {
18  }
19 
24  explicit USARTException(const std::string& message) : msg(message)
25  {
26  }
27 
31  virtual ~USARTException() = default;
32 
37  virtual const char* what() const throw ()
38  {
39  return msg.c_str();
40  }
41 
42 protected:
43  std::string msg;
44 };
45 
46 #endif // USARTEXCEPTION_H
USARTException::USARTException
USARTException(const char *message)
Definition: usartexception.h:16
USARTException
Definition: usartexception.h:9
USARTException::what
virtual const char * what() const
Definition: usartexception.h:37
USARTException::msg
std::string msg
failure description
Definition: usartexception.h:43
USARTException::USARTException
USARTException(const std::string &message)
Definition: usartexception.h:24
USARTException::~USARTException
virtual ~USARTException()=default