Struct aws_sdk_iot::error::SetV2LoggingOptionsError
source · #[non_exhaustive]pub struct SetV2LoggingOptionsError {
pub kind: SetV2LoggingOptionsErrorKind,
/* private fields */
}
Expand description
Error type for the SetV2LoggingOptions
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: SetV2LoggingOptionsErrorKind
Kind of error that occurred.
Implementations§
source§impl SetV2LoggingOptionsError
impl SetV2LoggingOptionsError
sourcepub fn new(kind: SetV2LoggingOptionsErrorKind, meta: Error) -> Self
pub fn new(kind: SetV2LoggingOptionsErrorKind, meta: Error) -> Self
Creates a new SetV2LoggingOptionsError
.
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 SetV2LoggingOptionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 25357)
25347 25348 25349 25350 25351 25352 25353 25354 25355 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381 25382 25383 25384 25385 25386 25387 25388 25389 25390 25391 25392 25393 25394 25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 25411 25412 25413 25414 25415 25416 25417 25418
pub fn parse_set_v2_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::SetV2LoggingOptionsOutput,
crate::error::SetV2LoggingOptionsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::SetV2LoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SetV2LoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::SetV2LoggingOptionsError {
meta: generic,
kind: crate::error::SetV2LoggingOptionsErrorKind::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::SetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::SetV2LoggingOptionsError {
meta: generic,
kind: crate::error::SetV2LoggingOptionsErrorKind::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::SetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::SetV2LoggingOptionsError {
meta: generic,
kind: crate::error::SetV2LoggingOptionsErrorKind::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::SetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SetV2LoggingOptionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the SetV2LoggingOptionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 25416)
25347 25348 25349 25350 25351 25352 25353 25354 25355 25356 25357 25358 25359 25360 25361 25362 25363 25364 25365 25366 25367 25368 25369 25370 25371 25372 25373 25374 25375 25376 25377 25378 25379 25380 25381 25382 25383 25384 25385 25386 25387 25388 25389 25390 25391 25392 25393 25394 25395 25396 25397 25398 25399 25400 25401 25402 25403 25404 25405 25406 25407 25408 25409 25410 25411 25412 25413 25414 25415 25416 25417 25418
pub fn parse_set_v2_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::SetV2LoggingOptionsOutput,
crate::error::SetV2LoggingOptionsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::SetV2LoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SetV2LoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::SetV2LoggingOptionsError {
meta: generic,
kind: crate::error::SetV2LoggingOptionsErrorKind::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::SetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::SetV2LoggingOptionsError {
meta: generic,
kind: crate::error::SetV2LoggingOptionsErrorKind::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::SetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::SetV2LoggingOptionsError {
meta: generic,
kind: crate::error::SetV2LoggingOptionsErrorKind::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::SetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SetV2LoggingOptionsError::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 SetV2LoggingOptionsErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is SetV2LoggingOptionsErrorKind::InvalidRequestException
.
Returns true
if the error kind is SetV2LoggingOptionsErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for SetV2LoggingOptionsError
impl Debug for SetV2LoggingOptionsError
source§impl Display for SetV2LoggingOptionsError
impl Display for SetV2LoggingOptionsError
source§impl Error for SetV2LoggingOptionsError
impl Error for SetV2LoggingOptionsError
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<SetV2LoggingOptionsError> for Error
impl From<SetV2LoggingOptionsError> for Error
source§fn from(err: SetV2LoggingOptionsError) -> Self
fn from(err: SetV2LoggingOptionsError) -> Self
Converts to this type from the input type.