Struct aws_sdk_backup::error::UpdateRegionSettingsError
source · #[non_exhaustive]pub struct UpdateRegionSettingsError {
pub kind: UpdateRegionSettingsErrorKind,
/* private fields */
}
Expand description
Error type for the UpdateRegionSettings
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: UpdateRegionSettingsErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdateRegionSettingsError
impl UpdateRegionSettingsError
sourcepub fn new(kind: UpdateRegionSettingsErrorKind, meta: Error) -> Self
pub fn new(kind: UpdateRegionSettingsErrorKind, meta: Error) -> Self
Creates a new UpdateRegionSettingsError
.
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 UpdateRegionSettingsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 7050)
7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111
pub fn parse_update_region_settings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdateRegionSettingsOutput,
crate::error::UpdateRegionSettingsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateRegionSettingsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateRegionSettingsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterValueException" => crate::error::UpdateRegionSettingsError {
meta: generic,
kind: crate::error::UpdateRegionSettingsErrorKind::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::UpdateRegionSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"MissingParameterValueException" => crate::error::UpdateRegionSettingsError {
meta: generic,
kind: crate::error::UpdateRegionSettingsErrorKind::MissingParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::missing_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_missing_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateRegionSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::UpdateRegionSettingsError {
meta: generic,
kind: crate::error::UpdateRegionSettingsErrorKind::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::UpdateRegionSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateRegionSettingsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateRegionSettingsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 7109)
7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111
pub fn parse_update_region_settings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdateRegionSettingsOutput,
crate::error::UpdateRegionSettingsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateRegionSettingsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateRegionSettingsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterValueException" => crate::error::UpdateRegionSettingsError {
meta: generic,
kind: crate::error::UpdateRegionSettingsErrorKind::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::UpdateRegionSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"MissingParameterValueException" => crate::error::UpdateRegionSettingsError {
meta: generic,
kind: crate::error::UpdateRegionSettingsErrorKind::MissingParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::missing_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_missing_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateRegionSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::UpdateRegionSettingsError {
meta: generic,
kind: crate::error::UpdateRegionSettingsErrorKind::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::UpdateRegionSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateRegionSettingsError::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 UpdateRegionSettingsErrorKind::InvalidParameterValueException
.
sourcepub fn is_missing_parameter_value_exception(&self) -> bool
pub fn is_missing_parameter_value_exception(&self) -> bool
Returns true
if the error kind is UpdateRegionSettingsErrorKind::MissingParameterValueException
.
Returns true
if the error kind is UpdateRegionSettingsErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for UpdateRegionSettingsError
impl Debug for UpdateRegionSettingsError
source§impl Display for UpdateRegionSettingsError
impl Display for UpdateRegionSettingsError
source§impl Error for UpdateRegionSettingsError
impl Error for UpdateRegionSettingsError
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<UpdateRegionSettingsError> for Error
impl From<UpdateRegionSettingsError> for Error
source§fn from(err: UpdateRegionSettingsError) -> Self
fn from(err: UpdateRegionSettingsError) -> Self
Converts to this type from the input type.