Struct aws_sdk_iot::error::StopThingRegistrationTaskError
source · #[non_exhaustive]pub struct StopThingRegistrationTaskError {
pub kind: StopThingRegistrationTaskErrorKind,
/* private fields */
}
Expand description
Error type for the StopThingRegistrationTask
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: StopThingRegistrationTaskErrorKind
Kind of error that occurred.
Implementations§
source§impl StopThingRegistrationTaskError
impl StopThingRegistrationTaskError
sourcepub fn new(kind: StopThingRegistrationTaskErrorKind, meta: Error) -> Self
pub fn new(kind: StopThingRegistrationTaskErrorKind, meta: Error) -> Self
Creates a new StopThingRegistrationTaskError
.
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 StopThingRegistrationTaskError::Unhandled
variant from any error type.
Examples found in repository?
25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 25943 25944 25945 25946 25947 25948 25949 25950 25951 25952 25953 25954 25955 25956 25957 25958 25959 25960 25961 25962 25963 25964 25965 25966 25967 25968 25969 25970 25971 25972 25973 25974 25975 25976 25977 25978 25979 25980 25981 25982 25983 25984 25985 25986 25987 25988 25989 25990 25991 25992 25993 25994 25995 25996 25997 25998 25999 26000 26001 26002 26003 26004 26005 26006 26007 26008 26009 26010 26011 26012 26013 26014 26015 26016 26017 26018 26019 26020 26021 26022 26023 26024 26025 26026 26027 26028 26029 26030 26031 26032 26033 26034 26035 26036 26037 26038 26039
pub fn parse_stop_thing_registration_task_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopThingRegistrationTaskOutput,
crate::error::StopThingRegistrationTaskError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopThingRegistrationTaskError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::InternalFailureException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::ThrottlingException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopThingRegistrationTaskError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopThingRegistrationTaskError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
25933 25934 25935 25936 25937 25938 25939 25940 25941 25942 25943 25944 25945 25946 25947 25948 25949 25950 25951 25952 25953 25954 25955 25956 25957 25958 25959 25960 25961 25962 25963 25964 25965 25966 25967 25968 25969 25970 25971 25972 25973 25974 25975 25976 25977 25978 25979 25980 25981 25982 25983 25984 25985 25986 25987 25988 25989 25990 25991 25992 25993 25994 25995 25996 25997 25998 25999 26000 26001 26002 26003 26004 26005 26006 26007 26008 26009 26010 26011 26012 26013 26014 26015 26016 26017 26018 26019 26020 26021 26022 26023 26024 26025 26026 26027 26028 26029 26030 26031 26032 26033 26034 26035 26036 26037 26038 26039
pub fn parse_stop_thing_registration_task_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopThingRegistrationTaskOutput,
crate::error::StopThingRegistrationTaskError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopThingRegistrationTaskError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::InternalFailureException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::ThrottlingException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::StopThingRegistrationTaskError {
meta: generic,
kind: crate::error::StopThingRegistrationTaskErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopThingRegistrationTaskError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopThingRegistrationTaskError::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_failure_exception(&self) -> bool
pub fn is_internal_failure_exception(&self) -> bool
Returns true
if the error kind is StopThingRegistrationTaskErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is StopThingRegistrationTaskErrorKind::InvalidRequestException
.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true
if the error kind is StopThingRegistrationTaskErrorKind::ResourceNotFoundException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is StopThingRegistrationTaskErrorKind::ThrottlingException
.
Returns true
if the error kind is StopThingRegistrationTaskErrorKind::UnauthorizedException
.