Struct aws_sdk_ssm::error::ResetServiceSettingError
source · #[non_exhaustive]pub struct ResetServiceSettingError {
pub kind: ResetServiceSettingErrorKind,
/* private fields */
}
Expand description
Error type for the ResetServiceSetting
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: ResetServiceSettingErrorKind
Kind of error that occurred.
Implementations§
source§impl ResetServiceSettingError
impl ResetServiceSettingError
sourcepub fn new(kind: ResetServiceSettingErrorKind, meta: Error) -> Self
pub fn new(kind: ResetServiceSettingErrorKind, meta: Error) -> Self
Creates a new ResetServiceSettingError
.
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 ResetServiceSettingError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 11072)
11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132
pub fn parse_reset_service_setting_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ResetServiceSettingOutput,
crate::error::ResetServiceSettingError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ResetServiceSettingError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ResetServiceSettingError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::ResetServiceSettingError {
meta: generic,
kind: crate::error::ResetServiceSettingErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResetServiceSettingError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceSettingNotFound" => crate::error::ResetServiceSettingError {
meta: generic,
kind: crate::error::ResetServiceSettingErrorKind::ServiceSettingNotFound({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_setting_not_found::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_setting_not_found_json_err(response.body().as_ref(), output).map_err(crate::error::ResetServiceSettingError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyUpdates" => {
crate::error::ResetServiceSettingError {
meta: generic,
kind: crate::error::ResetServiceSettingErrorKind::TooManyUpdates({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_updates::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_updates_json_err(response.body().as_ref(), output).map_err(crate::error::ResetServiceSettingError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::ResetServiceSettingError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ResetServiceSettingError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 11130)
11062 11063 11064 11065 11066 11067 11068 11069 11070 11071 11072 11073 11074 11075 11076 11077 11078 11079 11080 11081 11082 11083 11084 11085 11086 11087 11088 11089 11090 11091 11092 11093 11094 11095 11096 11097 11098 11099 11100 11101 11102 11103 11104 11105 11106 11107 11108 11109 11110 11111 11112 11113 11114 11115 11116 11117 11118 11119 11120 11121 11122 11123 11124 11125 11126 11127 11128 11129 11130 11131 11132
pub fn parse_reset_service_setting_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ResetServiceSettingOutput,
crate::error::ResetServiceSettingError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ResetServiceSettingError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ResetServiceSettingError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::ResetServiceSettingError {
meta: generic,
kind: crate::error::ResetServiceSettingErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::ResetServiceSettingError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceSettingNotFound" => crate::error::ResetServiceSettingError {
meta: generic,
kind: crate::error::ResetServiceSettingErrorKind::ServiceSettingNotFound({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_setting_not_found::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_setting_not_found_json_err(response.body().as_ref(), output).map_err(crate::error::ResetServiceSettingError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyUpdates" => {
crate::error::ResetServiceSettingError {
meta: generic,
kind: crate::error::ResetServiceSettingErrorKind::TooManyUpdates({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_updates::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_updates_json_err(response.body().as_ref(), output).map_err(crate::error::ResetServiceSettingError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::ResetServiceSettingError::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_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is ResetServiceSettingErrorKind::InternalServerError
.
sourcepub fn is_service_setting_not_found(&self) -> bool
pub fn is_service_setting_not_found(&self) -> bool
Returns true
if the error kind is ResetServiceSettingErrorKind::ServiceSettingNotFound
.
sourcepub fn is_too_many_updates(&self) -> bool
pub fn is_too_many_updates(&self) -> bool
Returns true
if the error kind is ResetServiceSettingErrorKind::TooManyUpdates
.
Trait Implementations§
source§impl Debug for ResetServiceSettingError
impl Debug for ResetServiceSettingError
source§impl Display for ResetServiceSettingError
impl Display for ResetServiceSettingError
source§impl Error for ResetServiceSettingError
impl Error for ResetServiceSettingError
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<ResetServiceSettingError> for Error
impl From<ResetServiceSettingError> for Error
source§fn from(err: ResetServiceSettingError) -> Self
fn from(err: ResetServiceSettingError) -> Self
Converts to this type from the input type.