#[non_exhaustive]pub struct ListDocumentClassifierSummariesError {
pub kind: ListDocumentClassifierSummariesErrorKind,
/* private fields */
}Expand description
Error type for the ListDocumentClassifierSummaries 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: ListDocumentClassifierSummariesErrorKindKind of error that occurred.
Implementations§
source§impl ListDocumentClassifierSummariesError
impl ListDocumentClassifierSummariesError
sourcepub fn new(kind: ListDocumentClassifierSummariesErrorKind, meta: Error) -> Self
pub fn new(kind: ListDocumentClassifierSummariesErrorKind, meta: Error) -> Self
Creates a new ListDocumentClassifierSummariesError.
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 ListDocumentClassifierSummariesError::Unhandled variant from any error type.
Examples found in repository?
4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671
pub fn parse_list_document_classifier_summaries_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListDocumentClassifierSummariesOutput,
crate::error::ListDocumentClassifierSummariesError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListDocumentClassifierSummariesError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListDocumentClassifierSummariesError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::ListDocumentClassifierSummariesError {
meta: generic,
kind: crate::error::ListDocumentClassifierSummariesErrorKind::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::ListDocumentClassifierSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::ListDocumentClassifierSummariesError {
meta: generic,
kind: crate::error::ListDocumentClassifierSummariesErrorKind::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::ListDocumentClassifierSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyRequestsException" => crate::error::ListDocumentClassifierSummariesError {
meta: generic,
kind: crate::error::ListDocumentClassifierSummariesErrorKind::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::ListDocumentClassifierSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::ListDocumentClassifierSummariesError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListDocumentClassifierSummariesError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671
pub fn parse_list_document_classifier_summaries_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListDocumentClassifierSummariesOutput,
crate::error::ListDocumentClassifierSummariesError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListDocumentClassifierSummariesError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListDocumentClassifierSummariesError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerException" => crate::error::ListDocumentClassifierSummariesError {
meta: generic,
kind: crate::error::ListDocumentClassifierSummariesErrorKind::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::ListDocumentClassifierSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::ListDocumentClassifierSummariesError {
meta: generic,
kind: crate::error::ListDocumentClassifierSummariesErrorKind::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::ListDocumentClassifierSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"TooManyRequestsException" => crate::error::ListDocumentClassifierSummariesError {
meta: generic,
kind: crate::error::ListDocumentClassifierSummariesErrorKind::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::ListDocumentClassifierSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::ListDocumentClassifierSummariesError::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 ListDocumentClassifierSummariesErrorKind::InternalServerException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is ListDocumentClassifierSummariesErrorKind::InvalidRequestException.
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 ListDocumentClassifierSummariesErrorKind::TooManyRequestsException.