#[non_exhaustive]pub struct StopTargetedSentimentDetectionJobError {
pub kind: StopTargetedSentimentDetectionJobErrorKind,
/* private fields */
}Expand description
Error type for the StopTargetedSentimentDetectionJob 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: StopTargetedSentimentDetectionJobErrorKindKind of error that occurred.
Implementations§
source§impl StopTargetedSentimentDetectionJobError
impl StopTargetedSentimentDetectionJobError
sourcepub fn new(kind: StopTargetedSentimentDetectionJobErrorKind, meta: Error) -> Self
pub fn new(kind: StopTargetedSentimentDetectionJobErrorKind, meta: Error) -> Self
Creates a new StopTargetedSentimentDetectionJobError.
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 StopTargetedSentimentDetectionJobError::Unhandled variant from any error type.
Examples found in repository?
7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990
pub fn parse_stop_targeted_sentiment_detection_job_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopTargetedSentimentDetectionJobOutput,
crate::error::StopTargetedSentimentDetectionJobError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopTargetedSentimentDetectionJobError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopTargetedSentimentDetectionJobError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StopTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StopTargetedSentimentDetectionJobErrorKind::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::StopTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::StopTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StopTargetedSentimentDetectionJobErrorKind::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::StopTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"JobNotFoundException" => crate::error::StopTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StopTargetedSentimentDetectionJobErrorKind::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::StopTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopTargetedSentimentDetectionJobError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopTargetedSentimentDetectionJobError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990
pub fn parse_stop_targeted_sentiment_detection_job_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopTargetedSentimentDetectionJobOutput,
crate::error::StopTargetedSentimentDetectionJobError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopTargetedSentimentDetectionJobError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopTargetedSentimentDetectionJobError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StopTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StopTargetedSentimentDetectionJobErrorKind::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::StopTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::StopTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StopTargetedSentimentDetectionJobErrorKind::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::StopTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"JobNotFoundException" => crate::error::StopTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StopTargetedSentimentDetectionJobErrorKind::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::StopTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopTargetedSentimentDetectionJobError::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 StopTargetedSentimentDetectionJobErrorKind::InternalServerException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is StopTargetedSentimentDetectionJobErrorKind::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 StopTargetedSentimentDetectionJobErrorKind::JobNotFoundException.