pub use crate::types::error::_service_quota_exceeded_exception::ServiceQuotaExceededException;
pub use crate::types::error::_conflict_exception::ConflictException;
pub use crate::types::error::_bad_gateway_exception::BadGatewayException;
pub use crate::types::error::_throttling_exception::ThrottlingException;
pub use crate::types::error::_resource_not_found_exception::ResourceNotFoundException;
pub use crate::types::error::_internal_server_exception::InternalServerException;
pub use crate::types::error::_validation_exception::ValidationException;
pub use crate::types::error::_dependency_failed_exception::DependencyFailedException;
pub use crate::types::error::_access_denied_exception::AccessDeniedException;
#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum ResponseStreamError {
InternalServerException(crate::types::error::InternalServerException),
ValidationException(crate::types::error::ValidationException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
ThrottlingException(crate::types::error::ThrottlingException),
AccessDeniedException(crate::types::error::AccessDeniedException),
ConflictException(crate::types::error::ConflictException),
DependencyFailedException(crate::types::error::DependencyFailedException),
BadGatewayException(crate::types::error::BadGatewayException),
#[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
variable wildcard pattern and check `.code()`:
\
`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
\
See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ResponseStreamError) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ResponseStreamError {
pub fn unhandled(
err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.into(),
meta: ::std::default::Default::default(),
})
}
pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: err.clone().into(),
meta: err,
})
}
pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ValidationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ServiceQuotaExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::ConflictException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::DependencyFailedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::BadGatewayException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
Self::Unhandled(e) => &e.meta,
}
}
pub fn is_internal_server_exception(&self) -> bool {
matches!(self, Self::InternalServerException(_))
}
pub fn is_validation_exception(&self) -> bool {
matches!(self, Self::ValidationException(_))
}
pub fn is_resource_not_found_exception(&self) -> bool {
matches!(self, Self::ResourceNotFoundException(_))
}
pub fn is_service_quota_exceeded_exception(&self) -> bool {
matches!(self, Self::ServiceQuotaExceededException(_))
}
pub fn is_throttling_exception(&self) -> bool {
matches!(self, Self::ThrottlingException(_))
}
pub fn is_access_denied_exception(&self) -> bool {
matches!(self, Self::AccessDeniedException(_))
}
pub fn is_conflict_exception(&self) -> bool {
matches!(self, Self::ConflictException(_))
}
pub fn is_dependency_failed_exception(&self) -> bool {
matches!(self, Self::DependencyFailedException(_))
}
pub fn is_bad_gateway_exception(&self) -> bool {
matches!(self, Self::BadGatewayException(_))
}
}
impl ::std::error::Error for ResponseStreamError {
fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Self::InternalServerException(_inner) => ::std::option::Option::Some(_inner),
Self::ValidationException(_inner) => ::std::option::Option::Some(_inner),
Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
Self::ServiceQuotaExceededException(_inner) => ::std::option::Option::Some(_inner),
Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
Self::ConflictException(_inner) => ::std::option::Option::Some(_inner),
Self::DependencyFailedException(_inner) => ::std::option::Option::Some(_inner),
Self::BadGatewayException(_inner) => ::std::option::Option::Some(_inner),
Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
}
}
}
impl ::std::fmt::Display for ResponseStreamError {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
match self {
Self::InternalServerException(_inner) => _inner.fmt(f),
Self::ValidationException(_inner) => _inner.fmt(f),
Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
Self::ServiceQuotaExceededException(_inner) => _inner.fmt(f),
Self::ThrottlingException(_inner) => _inner.fmt(f),
Self::AccessDeniedException(_inner) => _inner.fmt(f),
Self::ConflictException(_inner) => _inner.fmt(f),
Self::DependencyFailedException(_inner) => _inner.fmt(f),
Self::BadGatewayException(_inner) => _inner.fmt(f),
Self::Unhandled(_inner) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl ::aws_smithy_types::retry::ProvideErrorKind for ResponseStreamError {
fn code(&self) -> ::std::option::Option<&str> {
::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
}
fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
::std::option::Option::None
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ResponseStreamError {
fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
match self {
Self::InternalServerException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ValidationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ServiceQuotaExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::ConflictException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::DependencyFailedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::BadGatewayException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
Self::Unhandled(_inner) => &_inner.meta,
}
}
}
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResponseStreamError {
fn create_unhandled_error(
source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
) -> Self {
Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
source,
meta: meta.unwrap_or_default(),
})
}
}
impl ::aws_types::request_id::RequestId for crate::types::error::ResponseStreamError {
fn request_id(&self) -> Option<&str> {
self.meta().request_id()
}
}
mod _access_denied_exception;
mod _bad_gateway_exception;
mod _conflict_exception;
mod _dependency_failed_exception;
mod _internal_server_exception;
mod _resource_not_found_exception;
mod _service_quota_exceeded_exception;
mod _throttling_exception;
mod _validation_exception;
pub mod builders;