24 #ifndef __mqtt_exception_h 25 #define __mqtt_exception_h 27 #include "MQTTAsync.h" 93 const char *msg = ::MQTTAsync_strerror(rc);
103 auto msg = ::MQTTReasonCode_toString(MQTTReasonCodes(reasonCode));
104 if (msg)
return string(msg);
118 const string& msg=
string()) {
121 s +=
string(
": ") + msg;
184 :
exception(MQTTASYNC_FAILURE,
"Missing "+rsp+
" response") {}
225 :
exception(MQTTCLIENT_PERSISTENCE_ERROR, msg) {}
261 #endif // __mqtt_token_h std::bad_cast bad_cast
Definition: exception.h:38
static string error_str(int rc)
Definition: exception.h:92
int get_reason_code() const
Definition: exception.h:139
int get_return_code() const
Definition: exception.h:129
persistence_exception(int code, const string &msg)
Definition: exception.h:231
Definition: exception.h:176
std::string string
Definition: types.h:40
persistence_exception(const string &msg)
Definition: exception.h:224
string get_reason_code_str() const
Definition: exception.h:146
Definition: exception.h:208
Definition: exception.h:193
exception(int rc)
Definition: exception.h:61
string msg_
Definition: exception.h:54
string to_string(const char *cstr)
Definition: types.h:175
int rc_
Definition: exception.h:50
security_exception(int code, const string &msg)
Definition: exception.h:254
Definition: exception.h:46
static string reason_code_str(int reasonCode)
Definition: exception.h:101
Definition: exception.h:241
persistence_exception(int code)
Definition: exception.h:219
ReasonCode reasonCode_
Definition: exception.h:52
missing_response(const string &rsp)
Definition: exception.h:183
timeout_error()
Definition: exception.h:199
ReasonCode
Definition: types.h:57
string get_message() const
Definition: exception.h:152
exception(int rc, ReasonCode reasonCode)
Definition: exception.h:68
persistence_exception()
Definition: exception.h:214
exception(int rc, const string &msg)
Definition: exception.h:75
Definition: async_client.h:49
std::ostream & operator<<(std::ostream &os, const buffer_ref< T > &buf)
Definition: buffer_ref.h:279
string to_string() const
Definition: exception.h:157
exception(int rc, ReasonCode reasonCode, const string &msg)
Definition: exception.h:84
static string printable_error(int rc, int reasonCode=ReasonCode::SUCCESS, const string &msg=string())
Definition: exception.h:117
string get_error_str() const
Definition: exception.h:134
security_exception(int code)
Definition: exception.h:248