#[non_exhaustive]pub struct GetMaintenanceWindowExecutionTaskInvocationError {
pub kind: GetMaintenanceWindowExecutionTaskInvocationErrorKind,
/* private fields */
}
Expand description
Error type for the GetMaintenanceWindowExecutionTaskInvocation
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: GetMaintenanceWindowExecutionTaskInvocationErrorKind
Kind of error that occurred.
Implementations§
source§impl GetMaintenanceWindowExecutionTaskInvocationError
impl GetMaintenanceWindowExecutionTaskInvocationError
sourcepub fn new(
kind: GetMaintenanceWindowExecutionTaskInvocationErrorKind,
meta: Error
) -> Self
pub fn new(
kind: GetMaintenanceWindowExecutionTaskInvocationErrorKind,
meta: Error
) -> Self
Creates a new GetMaintenanceWindowExecutionTaskInvocationError
.
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 GetMaintenanceWindowExecutionTaskInvocationError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 6858)
6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895
pub fn parse_get_maintenance_window_execution_task_invocation_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetMaintenanceWindowExecutionTaskInvocationOutput,
crate::error::GetMaintenanceWindowExecutionTaskInvocationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetMaintenanceWindowExecutionTaskInvocationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::GetMaintenanceWindowExecutionTaskInvocationError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DoesNotExistException" => crate::error::GetMaintenanceWindowExecutionTaskInvocationError { meta: generic, kind: crate::error::GetMaintenanceWindowExecutionTaskInvocationErrorKind::DoesNotExistException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::does_not_exist_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_does_not_exist_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetMaintenanceWindowExecutionTaskInvocationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerError" => crate::error::GetMaintenanceWindowExecutionTaskInvocationError { meta: generic, kind: crate::error::GetMaintenanceWindowExecutionTaskInvocationErrorKind::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::GetMaintenanceWindowExecutionTaskInvocationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetMaintenanceWindowExecutionTaskInvocationError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetMaintenanceWindowExecutionTaskInvocationError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 6893)
6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895
pub fn parse_get_maintenance_window_execution_task_invocation_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetMaintenanceWindowExecutionTaskInvocationOutput,
crate::error::GetMaintenanceWindowExecutionTaskInvocationError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetMaintenanceWindowExecutionTaskInvocationError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::GetMaintenanceWindowExecutionTaskInvocationError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DoesNotExistException" => crate::error::GetMaintenanceWindowExecutionTaskInvocationError { meta: generic, kind: crate::error::GetMaintenanceWindowExecutionTaskInvocationErrorKind::DoesNotExistException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::does_not_exist_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_does_not_exist_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetMaintenanceWindowExecutionTaskInvocationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerError" => crate::error::GetMaintenanceWindowExecutionTaskInvocationError { meta: generic, kind: crate::error::GetMaintenanceWindowExecutionTaskInvocationErrorKind::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::GetMaintenanceWindowExecutionTaskInvocationError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetMaintenanceWindowExecutionTaskInvocationError::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_does_not_exist_exception(&self) -> bool
pub fn is_does_not_exist_exception(&self) -> bool
Returns true
if the error kind is GetMaintenanceWindowExecutionTaskInvocationErrorKind::DoesNotExistException
.
sourcepub fn is_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is GetMaintenanceWindowExecutionTaskInvocationErrorKind::InternalServerError
.
Trait Implementations§
source§impl Error for GetMaintenanceWindowExecutionTaskInvocationError
impl Error for GetMaintenanceWindowExecutionTaskInvocationError
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<GetMaintenanceWindowExecutionTaskInvocationError> for Error
impl From<GetMaintenanceWindowExecutionTaskInvocationError> for Error
source§fn from(err: GetMaintenanceWindowExecutionTaskInvocationError) -> Self
fn from(err: GetMaintenanceWindowExecutionTaskInvocationError) -> Self
Converts to this type from the input type.