pub struct AIOProtocolError {Show 14 fields
pub message: Option<String>,
pub kind: AIOProtocolErrorKind,
pub is_shallow: bool,
pub is_remote: bool,
pub nested_error: Option<Box<dyn Error + Send + Sync>>,
pub header_name: Option<String>,
pub header_value: Option<String>,
pub timeout_name: Option<String>,
pub timeout_value: Option<Duration>,
pub property_name: Option<String>,
pub property_value: Option<Value>,
pub command_name: Option<String>,
pub protocol_version: Option<String>,
pub supported_protocol_major_versions: Option<Vec<u16>>,
}
Expand description
Represents an error that occurred in the Azure IoT Operations Protocol
Fields§
§message: Option<String>
The error message
kind: AIOProtocolErrorKind
The specific kind of error that occurred
is_shallow: bool
True if the error was identified immediately after the API was called, prior to any attempted network communication
is_remote: bool
True if the error was detected by a remote component
nested_error: Option<Box<dyn Error + Send + Sync>>
Error from a dependent component that caused this error
header_name: Option<String>
The name of a MQTT header that is missing or has an invalid value
header_value: Option<String>
The value of a MQTT header that is invalid
timeout_name: Option<String>
The name of a timeout condition that elapsed
timeout_value: Option<Duration>
The duration of a timeout condition that elapsed
property_name: Option<String>
The name of a function argument or a field in a struct or enum, configuration file, or environment variable that is missing or has an invalid value
property_value: Option<Value>
The value of a function argument or a field in a struct or enum, configuration file, or environment variable that is invalid
command_name: Option<String>
The name of a command relevant to the error being reported
protocol_version: Option<String>
The protocol version of the command request or response that was not supported.
supported_protocol_major_versions: Option<Vec<u16>>
The acceptable major protocol versions for the command executor if it rejected the command request, or for the command invoker if it rejected the command response.
Implementations§
Source§impl AIOProtocolError
impl AIOProtocolError
Sourcepub fn new_header_missing_error(
header_name: &str,
is_remote: bool,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_header_missing_error( header_name: &str, is_remote: bool, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for a missing MQTT header
Sourcepub fn new_header_invalid_error(
header_name: &str,
header_value: &str,
is_remote: bool,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_header_invalid_error( header_name: &str, header_value: &str, is_remote: bool, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an invalid MQTT header value
Sourcepub fn new_payload_invalid_error(
is_shallow: bool,
is_remote: bool,
nested_error: Option<Box<dyn Error + Send + Sync>>,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_payload_invalid_error( is_shallow: bool, is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an invalid MQTT payload
Sourcepub fn new_timeout_error(
is_remote: bool,
nested_error: Option<Box<dyn Error + Send + Sync>>,
timeout_name: &str,
timeout_value: Duration,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_timeout_error( is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, timeout_name: &str, timeout_value: Duration, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for a timeout
Sourcepub fn new_cancellation_error(
is_remote: bool,
nested_error: Option<Box<dyn Error + Send + Sync>>,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_cancellation_error( is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for a cancellation error
Sourcepub fn new_configuration_invalid_error(
nested_error: Option<Box<dyn Error + Send + Sync>>,
property_name: &str,
property_value: Value,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_configuration_invalid_error( nested_error: Option<Box<dyn Error + Send + Sync>>, property_name: &str, property_value: Value, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an invalid configuration error
Sourcepub fn new_state_invalid_error(
property_name: &str,
property_value: Option<Value>,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_state_invalid_error( property_name: &str, property_value: Option<Value>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an invalid state error
Sourcepub fn new_internal_logic_error(
is_shallow: bool,
is_remote: bool,
nested_error: Option<Box<dyn Error + Send + Sync>>,
property_name: &str,
property_value: Option<Value>,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_internal_logic_error( is_shallow: bool, is_remote: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, property_name: &str, property_value: Option<Value>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an internal logic error
Sourcepub fn new_unknown_error(
is_remote: bool,
is_shallow: bool,
nested_error: Option<Box<dyn Error + Send + Sync>>,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_unknown_error( is_remote: bool, is_shallow: bool, nested_error: Option<Box<dyn Error + Send + Sync>>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an unknown error
Sourcepub fn new_execution_exception_error(
property_name: Option<&str>,
property_value: Option<Value>,
message: Option<String>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_execution_exception_error( property_name: Option<&str>, property_value: Option<Value>, message: Option<String>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an execution exception error
Sourcepub fn new_mqtt_error(
message: Option<String>,
nested_error: Box<dyn Error + Send + Sync>,
command_name: Option<String>,
) -> AIOProtocolError
pub fn new_mqtt_error( message: Option<String>, nested_error: Box<dyn Error + Send + Sync>, command_name: Option<String>, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an MQTT communication error
Sourcepub fn new_unsupported_version_error(
message: Option<String>,
protocol_version: String,
supported_protocol_major_versions: Vec<u16>,
command_name: Option<String>,
is_shallow: bool,
is_remote: bool,
) -> AIOProtocolError
pub fn new_unsupported_version_error( message: Option<String>, protocol_version: String, supported_protocol_major_versions: Vec<u16>, command_name: Option<String>, is_shallow: bool, is_remote: bool, ) -> AIOProtocolError
Creates a new AIOProtocolError
for an unsupported request version error
Sourcepub fn ensure_error_message(&mut self)
pub fn ensure_error_message(&mut self)
Sets the error’s message to a default value if a custom message is not already set