Struct aws_sdk_iot::error::GetLoggingOptionsError
source · #[non_exhaustive]pub struct GetLoggingOptionsError {
pub kind: GetLoggingOptionsErrorKind,
/* private fields */
}
Expand description
Error type for the GetLoggingOptions
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: GetLoggingOptionsErrorKind
Kind of error that occurred.
Implementations§
source§impl GetLoggingOptionsError
impl GetLoggingOptionsError
sourcepub fn new(kind: GetLoggingOptionsErrorKind, meta: Error) -> Self
pub fn new(kind: GetLoggingOptionsErrorKind, meta: Error) -> Self
Creates a new GetLoggingOptionsError
.
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 GetLoggingOptionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 15649)
15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710
pub fn parse_get_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetLoggingOptionsOutput, crate::error::GetLoggingOptionsError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetLoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetLoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::GetLoggingOptionsError {
meta: generic,
kind: crate::error::GetLoggingOptionsErrorKind::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::GetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::GetLoggingOptionsError {
meta: generic,
kind: crate::error::GetLoggingOptionsErrorKind::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::GetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::GetLoggingOptionsError {
meta: generic,
kind: crate::error::GetLoggingOptionsErrorKind::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::GetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetLoggingOptionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetLoggingOptionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 15708)
15641 15642 15643 15644 15645 15646 15647 15648 15649 15650 15651 15652 15653 15654 15655 15656 15657 15658 15659 15660 15661 15662 15663 15664 15665 15666 15667 15668 15669 15670 15671 15672 15673 15674 15675 15676 15677 15678 15679 15680 15681 15682 15683 15684 15685 15686 15687 15688 15689 15690 15691 15692 15693 15694 15695 15696 15697 15698 15699 15700 15701 15702 15703 15704 15705 15706 15707 15708 15709 15710
pub fn parse_get_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetLoggingOptionsOutput, crate::error::GetLoggingOptionsError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetLoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetLoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::GetLoggingOptionsError {
meta: generic,
kind: crate::error::GetLoggingOptionsErrorKind::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::GetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::GetLoggingOptionsError {
meta: generic,
kind: crate::error::GetLoggingOptionsErrorKind::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::GetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::GetLoggingOptionsError {
meta: generic,
kind: crate::error::GetLoggingOptionsErrorKind::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::GetLoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetLoggingOptionsError::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 GetLoggingOptionsErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is GetLoggingOptionsErrorKind::InvalidRequestException
.
Returns true
if the error kind is GetLoggingOptionsErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for GetLoggingOptionsError
impl Debug for GetLoggingOptionsError
source§impl Display for GetLoggingOptionsError
impl Display for GetLoggingOptionsError
source§impl Error for GetLoggingOptionsError
impl Error for GetLoggingOptionsError
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<GetLoggingOptionsError> for Error
impl From<GetLoggingOptionsError> for Error
source§fn from(err: GetLoggingOptionsError) -> Self
fn from(err: GetLoggingOptionsError) -> Self
Converts to this type from the input type.