24 #ifndef __mqtt_exception_h
25 #define __mqtt_exception_h
27 #include "MQTTAsync.h"
56 : std::runtime_error(
"MQTT error ["+std::
to_string(code)+
"]"),
code_(code) {}
63 std::runtime_error(
"MQTT error ["+std::
to_string(code)+
"]: "+msg),
103 :
exception(MQTTCLIENT_PERSISTENCE_ERROR, msg) {}
139 #endif // __mqtt_token_h
persistence_exception(int code, const string &msg)
Creates an MQTT persistence exception.
Definition: exception.h:109
Basic types and type conversions for the Paho MQTT C++ library.
int get_reason_code() const
Returns the reason code for this exception.
Definition: exception.h:72
persistence_exception(const string &msg)
Creates an MQTT persistence exception.
Definition: exception.h:102
This exception is thrown by the implementor of the persistence interface if there is a problem readin...
Definition: exception.h:86
string msg_
The error message from the C library.
Definition: exception.h:48
security_exception(int code, const string &msg)
Creates an MQTT security exception.
Definition: exception.h:132
string to_string() const
Gets a string representation of this exception.
Definition: exception.h:77
Base mqtt::exception.
Definition: exception.h:42
int code_
The error code from the C library.
Definition: exception.h:46
Thrown when a client is not authorized to perform an operation, or if there is a problem with the sec...
Definition: exception.h:119
persistence_exception(int code)
Creates an MQTT persistence exception.
Definition: exception.h:97
exception(int code)
Creates an MQTT exception.
Definition: exception.h:55
exception(int code, const string &msg)
Creates an MQTT exception.
Definition: exception.h:62
persistence_exception()
Creates an MQTT persistence exception.
Definition: exception.h:92
string get_message() const
Returns the error message for this exception.
Definition: exception.h:68
security_exception(int code)
Creates an MQTT security exception.
Definition: exception.h:126