SPSP
Simple publish-subscribe protocol. Connects low power IoT clients to MQTT.
All Classes Files Functions Variables Typedefs Enumerations
exception.hpp
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <exception>
13 #include <string>
14 
15 namespace SPSP
16 {
21  class Exception : public std::exception
22  {
23  std::string m_msg;
24 
25  public:
31  explicit Exception(const std::string& msg) : m_msg{msg} {}
32 
38  virtual const char* what() const noexcept
39  {
40  return m_msg.c_str();
41  }
42  };
43 } // namespace SPSP
SPSP::Exception::what
virtual const char * what() const noexcept
Returns exception's message.
Definition: exception.hpp:38
SPSP::Exception::Exception
Exception(const std::string &msg)
Constructs a new exception.
Definition: exception.hpp:31
SPSP::Exception
Base SPSP exception.
Definition: exception.hpp:21