#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
AccessDeniedError(crate::error::AccessDeniedError),
BadRequestError(crate::error::BadRequestError),
GatewayTimeoutError(crate::error::GatewayTimeoutError),
InternalFailureError(crate::error::InternalFailureError),
NotAcceptableError(crate::error::NotAcceptableError),
QuotaExceededError(crate::error::QuotaExceededError),
RequestTooLargeError(crate::error::RequestTooLargeError),
ResourceConflictError(crate::error::ResourceConflictError),
ResourceNotFoundError(crate::error::ResourceNotFoundError),
SerializationError(crate::error::SerializationError),
ServiceUnavailableError(crate::error::ServiceUnavailableError),
ThrottlingError(crate::error::ThrottlingError),
UnauthorizedError(crate::error::UnauthorizedError),
UnknownOperationError(crate::error::UnknownOperationError),
UnmappedError(crate::error::UnmappedError),
UnsupportedMediaTypeError(crate::error::UnsupportedMediaTypeError),
ValidationError(crate::error::ValidationError),
Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::AccessDeniedError(inner) => inner.fmt(f),
Error::BadRequestError(inner) => inner.fmt(f),
Error::GatewayTimeoutError(inner) => inner.fmt(f),
Error::InternalFailureError(inner) => inner.fmt(f),
Error::NotAcceptableError(inner) => inner.fmt(f),
Error::QuotaExceededError(inner) => inner.fmt(f),
Error::RequestTooLargeError(inner) => inner.fmt(f),
Error::ResourceConflictError(inner) => inner.fmt(f),
Error::ResourceNotFoundError(inner) => inner.fmt(f),
Error::SerializationError(inner) => inner.fmt(f),
Error::ServiceUnavailableError(inner) => inner.fmt(f),
Error::ThrottlingError(inner) => inner.fmt(f),
Error::UnauthorizedError(inner) => inner.fmt(f),
Error::UnknownOperationError(inner) => inner.fmt(f),
Error::UnmappedError(inner) => inner.fmt(f),
Error::UnsupportedMediaTypeError(inner) => inner.fmt(f),
Error::ValidationError(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::GetTokenForIAMError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: aws_smithy_http::result::SdkError<crate::error::GetTokenForIAMError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(crate::error::Unhandled::new(err.into())),
}
}
}
impl From<crate::error::GetTokenForIAMError> for Error {
fn from(err: crate::error::GetTokenForIAMError) -> Self {
match err.kind {
crate::error::GetTokenForIAMErrorKind::AccessDeniedError(inner) => {
Error::AccessDeniedError(inner)
}
crate::error::GetTokenForIAMErrorKind::BadRequestError(inner) => {
Error::BadRequestError(inner)
}
crate::error::GetTokenForIAMErrorKind::GatewayTimeoutError(inner) => {
Error::GatewayTimeoutError(inner)
}
crate::error::GetTokenForIAMErrorKind::InternalFailureError(inner) => {
Error::InternalFailureError(inner)
}
crate::error::GetTokenForIAMErrorKind::NotAcceptableError(inner) => {
Error::NotAcceptableError(inner)
}
crate::error::GetTokenForIAMErrorKind::QuotaExceededError(inner) => {
Error::QuotaExceededError(inner)
}
crate::error::GetTokenForIAMErrorKind::RequestTooLargeError(inner) => {
Error::RequestTooLargeError(inner)
}
crate::error::GetTokenForIAMErrorKind::ResourceConflictError(inner) => {
Error::ResourceConflictError(inner)
}
crate::error::GetTokenForIAMErrorKind::ResourceNotFoundError(inner) => {
Error::ResourceNotFoundError(inner)
}
crate::error::GetTokenForIAMErrorKind::SerializationError(inner) => {
Error::SerializationError(inner)
}
crate::error::GetTokenForIAMErrorKind::ServiceUnavailableError(inner) => {
Error::ServiceUnavailableError(inner)
}
crate::error::GetTokenForIAMErrorKind::ThrottlingError(inner) => {
Error::ThrottlingError(inner)
}
crate::error::GetTokenForIAMErrorKind::UnauthorizedError(inner) => {
Error::UnauthorizedError(inner)
}
crate::error::GetTokenForIAMErrorKind::UnknownOperationError(inner) => {
Error::UnknownOperationError(inner)
}
crate::error::GetTokenForIAMErrorKind::UnmappedError(inner) => {
Error::UnmappedError(inner)
}
crate::error::GetTokenForIAMErrorKind::UnsupportedMediaTypeError(inner) => {
Error::UnsupportedMediaTypeError(inner)
}
crate::error::GetTokenForIAMErrorKind::ValidationError(inner) => {
Error::ValidationError(inner)
}
crate::error::GetTokenForIAMErrorKind::Unhandled(inner) => {
Error::Unhandled(crate::error::Unhandled::new(inner.into()))
}
}
}
}
impl std::error::Error for Error {}