Struct aws_sdk_iot::error::DeleteSecurityProfileError
source · #[non_exhaustive]pub struct DeleteSecurityProfileError {
pub kind: DeleteSecurityProfileErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteSecurityProfile
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: DeleteSecurityProfileErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteSecurityProfileError
impl DeleteSecurityProfileError
sourcepub fn new(kind: DeleteSecurityProfileErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteSecurityProfileErrorKind, meta: Error) -> Self
Creates a new DeleteSecurityProfileError
.
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 DeleteSecurityProfileError::Unhandled
variant from any error type.
Examples found in repository?
8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075
pub fn parse_delete_security_profile_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteSecurityProfileOutput,
crate::error::DeleteSecurityProfileError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteSecurityProfileError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteSecurityProfileError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::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::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::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::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::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::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"VersionConflictException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::VersionConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::version_conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_version_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteSecurityProfileError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteSecurityProfileError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075
pub fn parse_delete_security_profile_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteSecurityProfileOutput,
crate::error::DeleteSecurityProfileError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteSecurityProfileError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteSecurityProfileError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::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::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::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::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::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::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"VersionConflictException" => crate::error::DeleteSecurityProfileError {
meta: generic,
kind: crate::error::DeleteSecurityProfileErrorKind::VersionConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::version_conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_version_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteSecurityProfileError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteSecurityProfileError::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 DeleteSecurityProfileErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is DeleteSecurityProfileErrorKind::InvalidRequestException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is DeleteSecurityProfileErrorKind::ThrottlingException
.
sourcepub fn is_version_conflict_exception(&self) -> bool
pub fn is_version_conflict_exception(&self) -> bool
Returns true
if the error kind is DeleteSecurityProfileErrorKind::VersionConflictException
.