Struct aws_sdk_backup::error::ListFrameworksError
source · #[non_exhaustive]pub struct ListFrameworksError {
pub kind: ListFrameworksErrorKind,
/* private fields */
}
Expand description
Error type for the ListFrameworks
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: ListFrameworksErrorKind
Kind of error that occurred.
Implementations§
source§impl ListFrameworksError
impl ListFrameworksError
sourcepub fn new(kind: ListFrameworksErrorKind, meta: Error) -> Self
pub fn new(kind: ListFrameworksErrorKind, meta: Error) -> Self
Creates a new ListFrameworksError
.
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 ListFrameworksError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 4658)
4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701
pub fn parse_list_frameworks_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListFrameworksOutput, crate::error::ListFrameworksError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListFrameworksError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListFrameworksError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterValueException" => crate::error::ListFrameworksError {
meta: generic,
kind: crate::error::ListFrameworksErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFrameworksError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::ListFrameworksError {
meta: generic,
kind: crate::error::ListFrameworksErrorKind::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::ListFrameworksError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListFrameworksError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListFrameworksError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 4699)
4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701
pub fn parse_list_frameworks_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListFrameworksOutput, crate::error::ListFrameworksError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListFrameworksError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListFrameworksError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterValueException" => crate::error::ListFrameworksError {
meta: generic,
kind: crate::error::ListFrameworksErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListFrameworksError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::ListFrameworksError {
meta: generic,
kind: crate::error::ListFrameworksErrorKind::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::ListFrameworksError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListFrameworksError::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_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true
if the error kind is ListFrameworksErrorKind::InvalidParameterValueException
.
Returns true
if the error kind is ListFrameworksErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for ListFrameworksError
impl Debug for ListFrameworksError
source§impl Display for ListFrameworksError
impl Display for ListFrameworksError
source§impl Error for ListFrameworksError
impl Error for ListFrameworksError
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<ListFrameworksError> for Error
impl From<ListFrameworksError> for Error
source§fn from(err: ListFrameworksError) -> Self
fn from(err: ListFrameworksError) -> Self
Converts to this type from the input type.