#include <exception.h>
Base mqtt::exception. This wraps the error codes which originate from the underlying C library.
◆ exception() [1/4]
mqtt::exception::exception |
( |
int |
rc | ) |
|
|
inlineexplicit |
Creates an MQTT exception.
- Parameters
-
rc | The error return code from the C library. |
◆ exception() [2/4]
mqtt::exception::exception |
( |
int |
rc, |
|
|
ReasonCode |
reasonCode |
|
) |
| |
|
inlineexplicit |
Creates an MQTT exception.
- Parameters
-
rc | The error return code from the C library. |
reasonCode | The reason code from the server response. |
◆ exception() [3/4]
mqtt::exception::exception |
( |
int |
rc, |
|
|
const string & |
msg |
|
) |
| |
|
inline |
Creates an MQTT exception.
- Parameters
-
rc | The error return code from the C library. |
msg | The text message for the error. |
◆ exception() [4/4]
mqtt::exception::exception |
( |
int |
rc, |
|
|
ReasonCode |
reasonCode, |
|
|
const string & |
msg |
|
) |
| |
|
inline |
Creates an MQTT exception.
- Parameters
-
rc | The error return code from the C library. |
reasonCode | The reason code from the server |
msg | The text message for the error. |
◆ error_str()
static string mqtt::exception::error_str |
( |
int |
rc | ) |
|
|
inlinestatic |
Gets an error message from an error code.
- Parameters
-
rc | The error code from the C lib |
- Returns
- A string explanation of the error
◆ reason_code_str()
static string mqtt::exception::reason_code_str |
( |
int |
reasonCode | ) |
|
|
inlinestatic |
Gets a string describing the MQTT v5 reason code.
- Parameters
-
reasonCode | The MQTT v5 reason code. |
- Returns
- A string describing the reason code.
◆ printable_error()
Gets a detailed error message for an error code.
- Parameters
-
rc | The error code from the C lib |
reasonCode | The MQTT v5 reason code |
msg | An optional additional message. If none is provided, the error_str message is used. |
- Returns
- A string error message that includes the error code and an explanation message.
◆ get_return_code()
int mqtt::exception::get_return_code |
( |
| ) |
const |
|
inline |
Returns the return code for this exception.
◆ get_error_str()
string mqtt::exception::get_error_str |
( |
| ) |
const |
|
inline |
Gets a string of the error code.
- Returns
- A string of the error code.
◆ get_reason_code()
int mqtt::exception::get_reason_code |
( |
| ) |
const |
|
inline |
Returns the reason code for this exception. For MQTT v3 connections, this is actually the return code.
◆ get_reason_code_str()
string mqtt::exception::get_reason_code_str |
( |
| ) |
const |
|
inline |
Gets a string for the reason code.
- Returns
- A string for the reason code.
◆ get_message()
string mqtt::exception::get_message |
( |
| ) |
const |
|
inline |
Returns the error message for this exception.
◆ to_string()
string mqtt::exception::to_string |
( |
| ) |
const |
|
inline |
Gets a string representation of this exception.
- Returns
- A string representation of this exception.
◆ rc_
The error return code from the C library
◆ reasonCode_
The reason code from the server
◆ msg_
The error message from the C library
The documentation for this class was generated from the following file: