#[non_exhaustive]pub struct ModifyClusterSnapshotError {
pub kind: ModifyClusterSnapshotErrorKind,
/* private fields */
}Expand description
Error type for the ModifyClusterSnapshot 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: ModifyClusterSnapshotErrorKindKind of error that occurred.
Implementations§
source§impl ModifyClusterSnapshotError
impl ModifyClusterSnapshotError
sourcepub fn new(kind: ModifyClusterSnapshotErrorKind, meta: Error) -> Self
pub fn new(kind: ModifyClusterSnapshotErrorKind, meta: Error) -> Self
Creates a new ModifyClusterSnapshotError.
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 ModifyClusterSnapshotError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 9244)
9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305
pub fn parse_modify_cluster_snapshot_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ModifyClusterSnapshotOutput,
crate::error::ModifyClusterSnapshotError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ModifyClusterSnapshotError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ClusterSnapshotNotFound" => crate::error::ModifyClusterSnapshotError {
meta: generic,
kind: crate::error::ModifyClusterSnapshotErrorKind::ClusterSnapshotNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cluster_snapshot_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cluster_snapshot_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidClusterSnapshotState" => crate::error::ModifyClusterSnapshotError {
meta: generic,
kind: crate::error::ModifyClusterSnapshotErrorKind::InvalidClusterSnapshotStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_cluster_snapshot_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_cluster_snapshot_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRetentionPeriodFault" => crate::error::ModifyClusterSnapshotError {
meta: generic,
kind: crate::error::ModifyClusterSnapshotErrorKind::InvalidRetentionPeriodFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_retention_period_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_retention_period_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ModifyClusterSnapshotError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ModifyClusterSnapshotError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 9303)
9234 9235 9236 9237 9238 9239 9240 9241 9242 9243 9244 9245 9246 9247 9248 9249 9250 9251 9252 9253 9254 9255 9256 9257 9258 9259 9260 9261 9262 9263 9264 9265 9266 9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305
pub fn parse_modify_cluster_snapshot_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ModifyClusterSnapshotOutput,
crate::error::ModifyClusterSnapshotError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ModifyClusterSnapshotError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ClusterSnapshotNotFound" => crate::error::ModifyClusterSnapshotError {
meta: generic,
kind: crate::error::ModifyClusterSnapshotErrorKind::ClusterSnapshotNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cluster_snapshot_not_found_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cluster_snapshot_not_found_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidClusterSnapshotState" => crate::error::ModifyClusterSnapshotError {
meta: generic,
kind: crate::error::ModifyClusterSnapshotErrorKind::InvalidClusterSnapshotStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_cluster_snapshot_state_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_cluster_snapshot_state_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRetentionPeriodFault" => crate::error::ModifyClusterSnapshotError {
meta: generic,
kind: crate::error::ModifyClusterSnapshotErrorKind::InvalidRetentionPeriodFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_retention_period_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_retention_period_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::ModifyClusterSnapshotError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ModifyClusterSnapshotError::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_cluster_snapshot_not_found_fault(&self) -> bool
pub fn is_cluster_snapshot_not_found_fault(&self) -> bool
Returns true if the error kind is ModifyClusterSnapshotErrorKind::ClusterSnapshotNotFoundFault.
sourcepub fn is_invalid_cluster_snapshot_state_fault(&self) -> bool
pub fn is_invalid_cluster_snapshot_state_fault(&self) -> bool
Returns true if the error kind is ModifyClusterSnapshotErrorKind::InvalidClusterSnapshotStateFault.
sourcepub fn is_invalid_retention_period_fault(&self) -> bool
pub fn is_invalid_retention_period_fault(&self) -> bool
Returns true if the error kind is ModifyClusterSnapshotErrorKind::InvalidRetentionPeriodFault.
Trait Implementations§
source§impl Debug for ModifyClusterSnapshotError
impl Debug for ModifyClusterSnapshotError
source§impl Display for ModifyClusterSnapshotError
impl Display for ModifyClusterSnapshotError
source§impl Error for ModifyClusterSnapshotError
impl Error for ModifyClusterSnapshotError
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<ModifyClusterSnapshotError> for Error
impl From<ModifyClusterSnapshotError> for Error
source§fn from(err: ModifyClusterSnapshotError) -> Self
fn from(err: ModifyClusterSnapshotError) -> Self
Converts to this type from the input type.