Struct aws_sdk_ssm::error::StopAutomationExecutionError
source · #[non_exhaustive]pub struct StopAutomationExecutionError {
pub kind: StopAutomationExecutionErrorKind,
/* private fields */
}
Expand description
Error type for the StopAutomationExecution
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: StopAutomationExecutionErrorKind
Kind of error that occurred.
Implementations§
source§impl StopAutomationExecutionError
impl StopAutomationExecutionError
sourcepub fn new(kind: StopAutomationExecutionErrorKind, meta: Error) -> Self
pub fn new(kind: StopAutomationExecutionErrorKind, meta: Error) -> Self
Creates a new StopAutomationExecutionError
.
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 StopAutomationExecutionError::Unhandled
variant from any error type.
Examples found in repository?
11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061
pub fn parse_stop_automation_execution_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopAutomationExecutionOutput,
crate::error::StopAutomationExecutionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopAutomationExecutionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopAutomationExecutionError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AutomationExecutionNotFoundException" => crate::error::StopAutomationExecutionError { meta: generic, kind: crate::error::StopAutomationExecutionErrorKind::AutomationExecutionNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::automation_execution_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_automation_execution_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopAutomationExecutionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerError" => crate::error::StopAutomationExecutionError { meta: generic, kind: crate::error::StopAutomationExecutionErrorKind::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::StopAutomationExecutionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidAutomationStatusUpdateException" => crate::error::StopAutomationExecutionError { meta: generic, kind: crate::error::StopAutomationExecutionErrorKind::InvalidAutomationStatusUpdateException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_automation_status_update_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_automation_status_update_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopAutomationExecutionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::StopAutomationExecutionError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopAutomationExecutionError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
11998 11999 12000 12001 12002 12003 12004 12005 12006 12007 12008 12009 12010 12011 12012 12013 12014 12015 12016 12017 12018 12019 12020 12021 12022 12023 12024 12025 12026 12027 12028 12029 12030 12031 12032 12033 12034 12035 12036 12037 12038 12039 12040 12041 12042 12043 12044 12045 12046 12047 12048 12049 12050 12051 12052 12053 12054 12055 12056 12057 12058 12059 12060 12061
pub fn parse_stop_automation_execution_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopAutomationExecutionOutput,
crate::error::StopAutomationExecutionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopAutomationExecutionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopAutomationExecutionError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AutomationExecutionNotFoundException" => crate::error::StopAutomationExecutionError { meta: generic, kind: crate::error::StopAutomationExecutionErrorKind::AutomationExecutionNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::automation_execution_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_automation_execution_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopAutomationExecutionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerError" => crate::error::StopAutomationExecutionError { meta: generic, kind: crate::error::StopAutomationExecutionErrorKind::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::StopAutomationExecutionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidAutomationStatusUpdateException" => crate::error::StopAutomationExecutionError { meta: generic, kind: crate::error::StopAutomationExecutionErrorKind::InvalidAutomationStatusUpdateException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_automation_status_update_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_automation_status_update_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopAutomationExecutionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::StopAutomationExecutionError::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_automation_execution_not_found_exception(&self) -> bool
pub fn is_automation_execution_not_found_exception(&self) -> bool
Returns true
if the error kind is StopAutomationExecutionErrorKind::AutomationExecutionNotFoundException
.
sourcepub fn is_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is StopAutomationExecutionErrorKind::InternalServerError
.
sourcepub fn is_invalid_automation_status_update_exception(&self) -> bool
pub fn is_invalid_automation_status_update_exception(&self) -> bool
Returns true
if the error kind is StopAutomationExecutionErrorKind::InvalidAutomationStatusUpdateException
.