Struct aws_sdk_iot::error::DeleteRoleAliasError
source · #[non_exhaustive]pub struct DeleteRoleAliasError {
pub kind: DeleteRoleAliasErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteRoleAlias
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: DeleteRoleAliasErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteRoleAliasError
impl DeleteRoleAliasError
sourcepub fn new(kind: DeleteRoleAliasErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteRoleAliasErrorKind, meta: Error) -> Self
Creates a new DeleteRoleAliasError
.
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 DeleteRoleAliasError::Unhandled
variant from any error type.
Examples found in repository?
8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872
pub fn parse_delete_role_alias_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteRoleAliasOutput, crate::error::DeleteRoleAliasError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteRoleAliasError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteRoleAliasError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DeleteConflictException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::DeleteConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::delete_conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_delete_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalFailureException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteRoleAliasError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteRoleAliasError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872
pub fn parse_delete_role_alias_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteRoleAliasOutput, crate::error::DeleteRoleAliasError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteRoleAliasError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteRoleAliasError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DeleteConflictException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::DeleteConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::delete_conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_delete_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalFailureException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::DeleteRoleAliasError {
meta: generic,
kind: crate::error::DeleteRoleAliasErrorKind::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::DeleteRoleAliasError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteRoleAliasError::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_delete_conflict_exception(&self) -> bool
pub fn is_delete_conflict_exception(&self) -> bool
Returns true
if the error kind is DeleteRoleAliasErrorKind::DeleteConflictException
.
sourcepub fn is_internal_failure_exception(&self) -> bool
pub fn is_internal_failure_exception(&self) -> bool
Returns true
if the error kind is DeleteRoleAliasErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is DeleteRoleAliasErrorKind::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 DeleteRoleAliasErrorKind::ResourceNotFoundException
.
Returns true
if the error kind is DeleteRoleAliasErrorKind::ServiceUnavailableException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is DeleteRoleAliasErrorKind::ThrottlingException
.
Returns true
if the error kind is DeleteRoleAliasErrorKind::UnauthorizedException
.