Struct aws_sdk_iot::error::SetLoggingOptionsError
source · #[non_exhaustive]pub struct SetLoggingOptionsError {
pub kind: SetLoggingOptionsErrorKind,
/* private fields */
}
Expand description
Error type for the SetLoggingOptions
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: SetLoggingOptionsErrorKind
Kind of error that occurred.
Implementations§
source§impl SetLoggingOptionsError
impl SetLoggingOptionsError
sourcepub fn new(kind: SetLoggingOptionsErrorKind, meta: Error) -> Self
pub fn new(kind: SetLoggingOptionsErrorKind, meta: Error) -> Self
Creates a new SetLoggingOptionsError
.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the SetLoggingOptionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 25151)
25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25153 25154 25155 25156 25157 25158 25159 25160 25161 25162 25163 25164 25165 25166 25167 25168 25169 25170 25171 25172 25173 25174 25175 25176 25177 25178 25179 25180 25181 25182 25183 25184 25185 25186 25187 25188 25189 25190 25191 25192 25193 25194 25195 25196 25197 25198 25199 25200 25201 25202 25203 25204 25205 25206 25207 25208 25209 25210 25211 25212
pub fn parse_set_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::SetLoggingOptionsOutput, crate::error::SetLoggingOptionsError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::SetLoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SetLoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::SetLoggingOptionsError {
meta: generic,
kind: crate::error::SetLoggingOptionsErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::SetLoggingOptionsError {
meta: generic,
kind: crate::error::SetLoggingOptionsErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::SetLoggingOptionsError {
meta: generic,
kind: crate::error::SetLoggingOptionsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SetLoggingOptionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the SetLoggingOptionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 25210)
25143 25144 25145 25146 25147 25148 25149 25150 25151 25152 25153 25154 25155 25156 25157 25158 25159 25160 25161 25162 25163 25164 25165 25166 25167 25168 25169 25170 25171 25172 25173 25174 25175 25176 25177 25178 25179 25180 25181 25182 25183 25184 25185 25186 25187 25188 25189 25190 25191 25192 25193 25194 25195 25196 25197 25198 25199 25200 25201 25202 25203 25204 25205 25206 25207 25208 25209 25210 25211 25212
pub fn parse_set_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::SetLoggingOptionsOutput, crate::error::SetLoggingOptionsError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::SetLoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SetLoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::SetLoggingOptionsError {
meta: generic,
kind: crate::error::SetLoggingOptionsErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::SetLoggingOptionsError {
meta: generic,
kind: crate::error::SetLoggingOptionsErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::SetLoggingOptionsError {
meta: generic,
kind: crate::error::SetLoggingOptionsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SetLoggingOptionsError::generic(generic),
})
}
sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_internal_exception(&self) -> bool
pub fn is_internal_exception(&self) -> bool
Returns true
if the error kind is SetLoggingOptionsErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is SetLoggingOptionsErrorKind::InvalidRequestException
.
Returns true
if the error kind is SetLoggingOptionsErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for SetLoggingOptionsError
impl Debug for SetLoggingOptionsError
source§impl Display for SetLoggingOptionsError
impl Display for SetLoggingOptionsError
source§impl Error for SetLoggingOptionsError
impl Error for SetLoggingOptionsError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<SetLoggingOptionsError> for Error
impl From<SetLoggingOptionsError> for Error
source§fn from(err: SetLoggingOptionsError) -> Self
fn from(err: SetLoggingOptionsError) -> Self
Converts to this type from the input type.