#[non_exhaustive]pub struct StartTargetedSentimentDetectionJobError {
pub kind: StartTargetedSentimentDetectionJobErrorKind,
/* private fields */
}Expand description
Error type for the StartTargetedSentimentDetectionJob 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: StartTargetedSentimentDetectionJobErrorKindKind of error that occurred.
Implementations§
source§impl StartTargetedSentimentDetectionJobError
impl StartTargetedSentimentDetectionJobError
sourcepub fn new(
kind: StartTargetedSentimentDetectionJobErrorKind,
meta: Error
) -> Self
pub fn new(
kind: StartTargetedSentimentDetectionJobErrorKind,
meta: Error
) -> Self
Creates a new StartTargetedSentimentDetectionJobError.
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 StartTargetedSentimentDetectionJobError::Unhandled variant from any error type.
Examples found in repository?
7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193
pub fn parse_start_targeted_sentiment_detection_job_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartTargetedSentimentDetectionJobOutput,
crate::error::StartTargetedSentimentDetectionJobError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StartTargetedSentimentDetectionJobError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::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::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::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::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"KmsKeyValidationException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::KmsKeyValidationException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::kms_key_validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_key_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyRequestsException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::TooManyRequestsException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyTagsException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StartTargetedSentimentDetectionJobErrorKind::TooManyTagsException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_tags_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_tags_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::StartTargetedSentimentDetectionJobError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StartTargetedSentimentDetectionJobError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193
pub fn parse_start_targeted_sentiment_detection_job_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartTargetedSentimentDetectionJobOutput,
crate::error::StartTargetedSentimentDetectionJobError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StartTargetedSentimentDetectionJobError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::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::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::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::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"KmsKeyValidationException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::KmsKeyValidationException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::kms_key_validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_key_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyRequestsException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind:
crate::error::StartTargetedSentimentDetectionJobErrorKind::TooManyRequestsException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyTagsException" => crate::error::StartTargetedSentimentDetectionJobError {
meta: generic,
kind: crate::error::StartTargetedSentimentDetectionJobErrorKind::TooManyTagsException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_tags_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_tags_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartTargetedSentimentDetectionJobError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::StartTargetedSentimentDetectionJobError::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 StartTargetedSentimentDetectionJobErrorKind::InternalServerException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is StartTargetedSentimentDetectionJobErrorKind::InvalidRequestException.
sourcepub fn is_kms_key_validation_exception(&self) -> bool
pub fn is_kms_key_validation_exception(&self) -> bool
Returns true if the error kind is StartTargetedSentimentDetectionJobErrorKind::KmsKeyValidationException.
sourcepub fn is_too_many_requests_exception(&self) -> bool
pub fn is_too_many_requests_exception(&self) -> bool
Returns true if the error kind is StartTargetedSentimentDetectionJobErrorKind::TooManyRequestsException.
Returns true if the error kind is StartTargetedSentimentDetectionJobErrorKind::TooManyTagsException.