#[non_exhaustive]pub struct StopPiiEntitiesDetectionJobError {
pub kind: StopPiiEntitiesDetectionJobErrorKind,
/* private fields */
}Expand description
Error type for the StopPiiEntitiesDetectionJob 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: StopPiiEntitiesDetectionJobErrorKindKind of error that occurred.
Implementations§
source§impl StopPiiEntitiesDetectionJobError
impl StopPiiEntitiesDetectionJobError
sourcepub fn new(kind: StopPiiEntitiesDetectionJobErrorKind, meta: Error) -> Self
pub fn new(kind: StopPiiEntitiesDetectionJobErrorKind, meta: Error) -> Self
Creates a new StopPiiEntitiesDetectionJobError.
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 StopPiiEntitiesDetectionJobError::Unhandled variant from any error type.
Examples found in repository?
7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795
pub fn parse_stop_pii_entities_detection_job_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopPiiEntitiesDetectionJobOutput,
crate::error::StopPiiEntitiesDetectionJobError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopPiiEntitiesDetectionJobError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopPiiEntitiesDetectionJobError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StopPiiEntitiesDetectionJobError {
meta: generic,
kind: crate::error::StopPiiEntitiesDetectionJobErrorKind::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopPiiEntitiesDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::StopPiiEntitiesDetectionJobError {
meta: generic,
kind: crate::error::StopPiiEntitiesDetectionJobErrorKind::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::StopPiiEntitiesDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"JobNotFoundException" => crate::error::StopPiiEntitiesDetectionJobError {
meta: generic,
kind: crate::error::StopPiiEntitiesDetectionJobErrorKind::JobNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::job_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_job_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopPiiEntitiesDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopPiiEntitiesDetectionJobError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopPiiEntitiesDetectionJobError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795
pub fn parse_stop_pii_entities_detection_job_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopPiiEntitiesDetectionJobOutput,
crate::error::StopPiiEntitiesDetectionJobError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopPiiEntitiesDetectionJobError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopPiiEntitiesDetectionJobError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StopPiiEntitiesDetectionJobError {
meta: generic,
kind: crate::error::StopPiiEntitiesDetectionJobErrorKind::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopPiiEntitiesDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::StopPiiEntitiesDetectionJobError {
meta: generic,
kind: crate::error::StopPiiEntitiesDetectionJobErrorKind::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::StopPiiEntitiesDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"JobNotFoundException" => crate::error::StopPiiEntitiesDetectionJobError {
meta: generic,
kind: crate::error::StopPiiEntitiesDetectionJobErrorKind::JobNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::job_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_job_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopPiiEntitiesDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopPiiEntitiesDetectionJobError::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_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true if the error kind is StopPiiEntitiesDetectionJobErrorKind::InternalServerException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is StopPiiEntitiesDetectionJobErrorKind::InvalidRequestException.
sourcepub fn is_job_not_found_exception(&self) -> bool
pub fn is_job_not_found_exception(&self) -> bool
Returns true if the error kind is StopPiiEntitiesDetectionJobErrorKind::JobNotFoundException.