#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
ConcurrentModificationException(crate::types::error::ConcurrentModificationException),
InvalidPaginationToken(crate::types::error::InvalidPaginationToken),
UnsupportedLocale(crate::types::error::UnsupportedLocale),
#[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-Error) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::ConcurrentModificationException(inner) => inner.fmt(f),
Error::InvalidPaginationToken(inner) => inner.fmt(f),
Error::UnsupportedLocale(inner) => inner.fmt(f),
Error::Unhandled(_) => {
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 From<::aws_smithy_types::error::operation::BuildError> for Error {
fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: value.into(),
meta: ::std::default::Default::default(),
})
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
match self {
Self::ConcurrentModificationException(inner) => inner.meta(),
Self::InvalidPaginationToken(inner) => inner.meta(),
Self::UnsupportedLocale(inner) => inner.meta(),
Self::Unhandled(inner) => &inner.meta,
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_affected_accounts_for_organization::DescribeAffectedAccountsForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_affected_accounts_for_organization::DescribeAffectedAccountsForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_affected_accounts_for_organization::DescribeAffectedAccountsForOrganizationError> for Error {
fn from(err: crate::operation::describe_affected_accounts_for_organization::DescribeAffectedAccountsForOrganizationError) -> Self {
match err {
crate::operation::describe_affected_accounts_for_organization::DescribeAffectedAccountsForOrganizationError::InvalidPaginationToken(
inner,
) => Error::InvalidPaginationToken(inner),
crate::operation::describe_affected_accounts_for_organization::DescribeAffectedAccountsForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_affected_entities::DescribeAffectedEntitiesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_affected_entities::DescribeAffectedEntitiesError, R>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_affected_entities::DescribeAffectedEntitiesError> for Error {
fn from(err: crate::operation::describe_affected_entities::DescribeAffectedEntitiesError) -> Self {
match err {
crate::operation::describe_affected_entities::DescribeAffectedEntitiesError::InvalidPaginationToken(inner) => {
Error::InvalidPaginationToken(inner)
}
crate::operation::describe_affected_entities::DescribeAffectedEntitiesError::UnsupportedLocale(inner) => Error::UnsupportedLocale(inner),
crate::operation::describe_affected_entities::DescribeAffectedEntitiesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError> for Error {
fn from(err: crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError) -> Self {
match err {
crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError::InvalidPaginationToken(
inner,
) => Error::InvalidPaginationToken(inner),
crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError::UnsupportedLocale(inner) => {
Error::UnsupportedLocale(inner)
}
crate::operation::describe_affected_entities_for_organization::DescribeAffectedEntitiesForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_entity_aggregates::DescribeEntityAggregatesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_entity_aggregates::DescribeEntityAggregatesError, R>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_entity_aggregates::DescribeEntityAggregatesError> for Error {
fn from(err: crate::operation::describe_entity_aggregates::DescribeEntityAggregatesError) -> Self {
match err {
crate::operation::describe_entity_aggregates::DescribeEntityAggregatesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_entity_aggregates_for_organization::DescribeEntityAggregatesForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_entity_aggregates_for_organization::DescribeEntityAggregatesForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_entity_aggregates_for_organization::DescribeEntityAggregatesForOrganizationError> for Error {
fn from(err: crate::operation::describe_entity_aggregates_for_organization::DescribeEntityAggregatesForOrganizationError) -> Self {
match err {
crate::operation::describe_entity_aggregates_for_organization::DescribeEntityAggregatesForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_event_aggregates::DescribeEventAggregatesError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_event_aggregates::DescribeEventAggregatesError, R>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_event_aggregates::DescribeEventAggregatesError> for Error {
fn from(err: crate::operation::describe_event_aggregates::DescribeEventAggregatesError) -> Self {
match err {
crate::operation::describe_event_aggregates::DescribeEventAggregatesError::InvalidPaginationToken(inner) => {
Error::InvalidPaginationToken(inner)
}
crate::operation::describe_event_aggregates::DescribeEventAggregatesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_event_details::DescribeEventDetailsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_event_details::DescribeEventDetailsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_event_details::DescribeEventDetailsError> for Error {
fn from(err: crate::operation::describe_event_details::DescribeEventDetailsError) -> Self {
match err {
crate::operation::describe_event_details::DescribeEventDetailsError::UnsupportedLocale(inner) => Error::UnsupportedLocale(inner),
crate::operation::describe_event_details::DescribeEventDetailsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_event_details_for_organization::DescribeEventDetailsForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_event_details_for_organization::DescribeEventDetailsForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_event_details_for_organization::DescribeEventDetailsForOrganizationError> for Error {
fn from(err: crate::operation::describe_event_details_for_organization::DescribeEventDetailsForOrganizationError) -> Self {
match err {
crate::operation::describe_event_details_for_organization::DescribeEventDetailsForOrganizationError::UnsupportedLocale(inner) => {
Error::UnsupportedLocale(inner)
}
crate::operation::describe_event_details_for_organization::DescribeEventDetailsForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_events::DescribeEventsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_events::DescribeEventsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_events::DescribeEventsError> for Error {
fn from(err: crate::operation::describe_events::DescribeEventsError) -> Self {
match err {
crate::operation::describe_events::DescribeEventsError::InvalidPaginationToken(inner) => Error::InvalidPaginationToken(inner),
crate::operation::describe_events::DescribeEventsError::UnsupportedLocale(inner) => Error::UnsupportedLocale(inner),
crate::operation::describe_events::DescribeEventsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError, R>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError> for Error {
fn from(err: crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError) -> Self {
match err {
crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError::InvalidPaginationToken(inner) => {
Error::InvalidPaginationToken(inner)
}
crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError::UnsupportedLocale(inner) => {
Error::UnsupportedLocale(inner)
}
crate::operation::describe_events_for_organization::DescribeEventsForOrganizationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_event_types::DescribeEventTypesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_event_types::DescribeEventTypesError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_event_types::DescribeEventTypesError> for Error {
fn from(err: crate::operation::describe_event_types::DescribeEventTypesError) -> Self {
match err {
crate::operation::describe_event_types::DescribeEventTypesError::InvalidPaginationToken(inner) => Error::InvalidPaginationToken(inner),
crate::operation::describe_event_types::DescribeEventTypesError::UnsupportedLocale(inner) => Error::UnsupportedLocale(inner),
crate::operation::describe_event_types::DescribeEventTypesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_health_service_status_for_organization::DescribeHealthServiceStatusForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::describe_health_service_status_for_organization::DescribeHealthServiceStatusForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_health_service_status_for_organization::DescribeHealthServiceStatusForOrganizationError> for Error {
fn from(err: crate::operation::describe_health_service_status_for_organization::DescribeHealthServiceStatusForOrganizationError) -> Self {
match err {
crate::operation::describe_health_service_status_for_organization::DescribeHealthServiceStatusForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::disable_health_service_access_for_organization::DisableHealthServiceAccessForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::disable_health_service_access_for_organization::DisableHealthServiceAccessForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::disable_health_service_access_for_organization::DisableHealthServiceAccessForOrganizationError> for Error {
fn from(err: crate::operation::disable_health_service_access_for_organization::DisableHealthServiceAccessForOrganizationError) -> Self {
match err {
crate::operation::disable_health_service_access_for_organization::DisableHealthServiceAccessForOrganizationError::ConcurrentModificationException(inner) => Error::ConcurrentModificationException(inner),
crate::operation::disable_health_service_access_for_organization::DisableHealthServiceAccessForOrganizationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::enable_health_service_access_for_organization::EnableHealthServiceAccessForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::enable_health_service_access_for_organization::EnableHealthServiceAccessForOrganizationError,
R,
>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::enable_health_service_access_for_organization::EnableHealthServiceAccessForOrganizationError> for Error {
fn from(err: crate::operation::enable_health_service_access_for_organization::EnableHealthServiceAccessForOrganizationError) -> Self {
match err {
crate::operation::enable_health_service_access_for_organization::EnableHealthServiceAccessForOrganizationError::ConcurrentModificationException(inner) => Error::ConcurrentModificationException(inner),
crate::operation::enable_health_service_access_for_organization::EnableHealthServiceAccessForOrganizationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl ::std::error::Error for Error {
fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Error::ConcurrentModificationException(inner) => inner.source(),
Error::InvalidPaginationToken(inner) => inner.source(),
Error::UnsupportedLocale(inner) => inner.source(),
Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
}
}
}
impl ::aws_types::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::ConcurrentModificationException(e) => e.request_id(),
Self::InvalidPaginationToken(e) => e.request_id(),
Self::UnsupportedLocale(e) => e.request_id(),
Self::Unhandled(e) => e.meta.request_id(),
}
}
}