Struct aws_sdk_kms::error::ListKeysError
source · #[non_exhaustive]pub struct ListKeysError {
pub kind: ListKeysErrorKind,
/* private fields */
}
Expand description
Error type for the ListKeys
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: ListKeysErrorKind
Kind of error that occurred.
Implementations§
source§impl ListKeysError
impl ListKeysError
sourcepub fn new(kind: ListKeysErrorKind, meta: Error) -> Self
pub fn new(kind: ListKeysErrorKind, meta: Error) -> Self
Creates a new ListKeysError
.
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 ListKeysError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 4688)
4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746
pub fn parse_list_keys_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListKeysOutput, crate::error::ListKeysError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListKeysError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListKeysError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DependencyTimeoutException" => crate::error::ListKeysError {
meta: generic,
kind: crate::error::ListKeysErrorKind::DependencyTimeoutException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::dependency_timeout_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_dependency_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidMarkerException" => crate::error::ListKeysError {
meta: generic,
kind: crate::error::ListKeysErrorKind::InvalidMarkerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_marker_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_marker_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInternalException" => crate::error::ListKeysError {
meta: generic,
kind: crate::error::ListKeysErrorKind::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListKeysError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListKeysError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 4744)
4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746
pub fn parse_list_keys_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListKeysOutput, crate::error::ListKeysError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListKeysError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListKeysError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DependencyTimeoutException" => crate::error::ListKeysError {
meta: generic,
kind: crate::error::ListKeysErrorKind::DependencyTimeoutException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::dependency_timeout_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_dependency_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidMarkerException" => crate::error::ListKeysError {
meta: generic,
kind: crate::error::ListKeysErrorKind::InvalidMarkerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_marker_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_marker_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInternalException" => crate::error::ListKeysError {
meta: generic,
kind: crate::error::ListKeysErrorKind::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListKeysError::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_dependency_timeout_exception(&self) -> bool
pub fn is_dependency_timeout_exception(&self) -> bool
Returns true
if the error kind is ListKeysErrorKind::DependencyTimeoutException
.
sourcepub fn is_invalid_marker_exception(&self) -> bool
pub fn is_invalid_marker_exception(&self) -> bool
Returns true
if the error kind is ListKeysErrorKind::InvalidMarkerException
.
sourcepub fn is_kms_internal_exception(&self) -> bool
pub fn is_kms_internal_exception(&self) -> bool
Returns true
if the error kind is ListKeysErrorKind::KmsInternalException
.
Trait Implementations§
source§impl CreateUnhandledError for ListKeysError
impl CreateUnhandledError for ListKeysError
source§impl Debug for ListKeysError
impl Debug for ListKeysError
source§impl Display for ListKeysError
impl Display for ListKeysError
source§impl Error for ListKeysError
impl Error for ListKeysError
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<ListKeysError> for Error
impl From<ListKeysError> for Error
source§fn from(err: ListKeysError) -> Self
fn from(err: ListKeysError) -> Self
Converts to this type from the input type.