#[non_exhaustive]pub struct SetDesiredCapacityError {
pub kind: SetDesiredCapacityErrorKind,
/* private fields */
}Expand description
Error type for the SetDesiredCapacity 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: SetDesiredCapacityErrorKindKind of error that occurred.
Implementations§
source§impl SetDesiredCapacityError
impl SetDesiredCapacityError
sourcepub fn new(kind: SetDesiredCapacityErrorKind, meta: Error) -> Self
pub fn new(kind: SetDesiredCapacityErrorKind, meta: Error) -> Self
Creates a new SetDesiredCapacityError.
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 SetDesiredCapacityError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 3872)
3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914
pub fn parse_set_desired_capacity_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::SetDesiredCapacityOutput,
crate::error::SetDesiredCapacityError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::SetDesiredCapacityError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SetDesiredCapacityError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ResourceContention" => crate::error::SetDesiredCapacityError {
meta: generic,
kind: crate::error::SetDesiredCapacityErrorKind::ResourceContentionFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::resource_contention_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_resource_contention_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::SetDesiredCapacityError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ScalingActivityInProgress" => crate::error::SetDesiredCapacityError {
meta: generic,
kind: crate::error::SetDesiredCapacityErrorKind::ScalingActivityInProgressFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::scaling_activity_in_progress_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_scaling_activity_in_progress_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::SetDesiredCapacityError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SetDesiredCapacityError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the SetDesiredCapacityError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 3912)
3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914
pub fn parse_set_desired_capacity_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::SetDesiredCapacityOutput,
crate::error::SetDesiredCapacityError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::SetDesiredCapacityError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SetDesiredCapacityError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ResourceContention" => crate::error::SetDesiredCapacityError {
meta: generic,
kind: crate::error::SetDesiredCapacityErrorKind::ResourceContentionFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::resource_contention_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_resource_contention_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::SetDesiredCapacityError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ScalingActivityInProgress" => crate::error::SetDesiredCapacityError {
meta: generic,
kind: crate::error::SetDesiredCapacityErrorKind::ScalingActivityInProgressFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::scaling_activity_in_progress_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_scaling_activity_in_progress_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::SetDesiredCapacityError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SetDesiredCapacityError::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_resource_contention_fault(&self) -> bool
pub fn is_resource_contention_fault(&self) -> bool
Returns true if the error kind is SetDesiredCapacityErrorKind::ResourceContentionFault.
sourcepub fn is_scaling_activity_in_progress_fault(&self) -> bool
pub fn is_scaling_activity_in_progress_fault(&self) -> bool
Returns true if the error kind is SetDesiredCapacityErrorKind::ScalingActivityInProgressFault.
Trait Implementations§
source§impl Debug for SetDesiredCapacityError
impl Debug for SetDesiredCapacityError
source§impl Display for SetDesiredCapacityError
impl Display for SetDesiredCapacityError
source§impl Error for SetDesiredCapacityError
impl Error for SetDesiredCapacityError
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<SetDesiredCapacityError> for Error
impl From<SetDesiredCapacityError> for Error
source§fn from(err: SetDesiredCapacityError) -> Self
fn from(err: SetDesiredCapacityError) -> Self
Converts to this type from the input type.