#[non_exhaustive]pub struct StopTrainingDocumentClassifierError {
pub kind: StopTrainingDocumentClassifierErrorKind,
/* private fields */
}Expand description
Error type for the StopTrainingDocumentClassifier 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: StopTrainingDocumentClassifierErrorKindKind of error that occurred.
Implementations§
source§impl StopTrainingDocumentClassifierError
impl StopTrainingDocumentClassifierError
sourcepub fn new(kind: StopTrainingDocumentClassifierErrorKind, meta: Error) -> Self
pub fn new(kind: StopTrainingDocumentClassifierErrorKind, meta: Error) -> Self
Creates a new StopTrainingDocumentClassifierError.
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 StopTrainingDocumentClassifierError::Unhandled variant from any error type.
Examples found in repository?
8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101
pub fn parse_stop_training_document_classifier_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopTrainingDocumentClassifierOutput,
crate::error::StopTrainingDocumentClassifierError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopTrainingDocumentClassifierError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StopTrainingDocumentClassifierError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyRequestsException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::StopTrainingDocumentClassifierError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopTrainingDocumentClassifierError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101
pub fn parse_stop_training_document_classifier_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopTrainingDocumentClassifierOutput,
crate::error::StopTrainingDocumentClassifierError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopTrainingDocumentClassifierError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StopTrainingDocumentClassifierError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyRequestsException" => crate::error::StopTrainingDocumentClassifierError {
meta: generic,
kind: crate::error::StopTrainingDocumentClassifierErrorKind::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::StopTrainingDocumentClassifierError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::StopTrainingDocumentClassifierError::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 StopTrainingDocumentClassifierErrorKind::InternalServerException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is StopTrainingDocumentClassifierErrorKind::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 StopTrainingDocumentClassifierErrorKind::ResourceNotFoundException.
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 StopTrainingDocumentClassifierErrorKind::TooManyRequestsException.