aws_sdk_observabilityadmin/
error_meta.rs#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
AccessDeniedException(crate::types::error::AccessDeniedException),
InternalServerException(crate::types::error::InternalServerException),
ValidationException(crate::types::error::ValidationException),
#[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::AccessDeniedException(inner) => inner.fmt(f),
Error::InternalServerException(inner) => inner.fmt(f),
Error::ValidationException(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::AccessDeniedException(inner) => inner.meta(),
Self::InternalServerException(inner) => inner.meta(),
Self::ValidationException(inner) => inner.meta(),
Self::Unhandled(inner) => &inner.meta,
}
}
}
impl<R>
From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError,
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::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError> for Error {
fn from(err: crate::operation::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError) -> Self {
match err {
crate::operation::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::get_telemetry_evaluation_status::GetTelemetryEvaluationStatusError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError,
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::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError> for Error {
fn from(err: crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError) -> Self {
match err {
crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError::InternalServerException(inner) => Error::InternalServerException(inner),
crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::get_telemetry_evaluation_status_for_organization::GetTelemetryEvaluationStatusForOrganizationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_resource_telemetry::ListResourceTelemetryError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_resource_telemetry::ListResourceTelemetryError, 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::list_resource_telemetry::ListResourceTelemetryError> for Error {
fn from(err: crate::operation::list_resource_telemetry::ListResourceTelemetryError) -> Self {
match err {
crate::operation::list_resource_telemetry::ListResourceTelemetryError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::list_resource_telemetry::ListResourceTelemetryError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_resource_telemetry::ListResourceTelemetryError::ValidationException(inner) => Error::ValidationException(inner),
crate::operation::list_resource_telemetry::ListResourceTelemetryError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError,
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::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError> for Error {
fn from(err: crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError) -> Self {
match err {
crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::list_resource_telemetry_for_organization::ListResourceTelemetryForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError, 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::start_telemetry_evaluation::StartTelemetryEvaluationError> for Error {
fn from(err: crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError) -> Self {
match err {
crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::start_telemetry_evaluation::StartTelemetryEvaluationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError,
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::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError> for Error {
fn from(err: crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError) -> Self {
match err {
crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError::AccessDeniedException(
inner,
) => Error::AccessDeniedException(inner),
crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError::InternalServerException(
inner,
) => Error::InternalServerException(inner),
crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError::ValidationException(
inner,
) => Error::ValidationException(inner),
crate::operation::start_telemetry_evaluation_for_organization::StartTelemetryEvaluationForOrganizationError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError, 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::stop_telemetry_evaluation::StopTelemetryEvaluationError> for Error {
fn from(err: crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError) -> Self {
match err {
crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError::AccessDeniedException(inner) => {
Error::AccessDeniedException(inner)
}
crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError::InternalServerException(inner) => {
Error::InternalServerException(inner)
}
crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::stop_telemetry_evaluation::StopTelemetryEvaluationError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError,
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::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError> for Error {
fn from(err: crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError) -> Self {
match err {
crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError::AccessDeniedException(
inner,
) => Error::AccessDeniedException(inner),
crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError::InternalServerException(
inner,
) => Error::InternalServerException(inner),
crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError::ValidationException(inner) => {
Error::ValidationException(inner)
}
crate::operation::stop_telemetry_evaluation_for_organization::StopTelemetryEvaluationForOrganizationError::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::AccessDeniedException(inner) => inner.source(),
Error::InternalServerException(inner) => inner.source(),
Error::ValidationException(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::AccessDeniedException(e) => e.request_id(),
Self::InternalServerException(e) => e.request_id(),
Self::ValidationException(e) => e.request_id(),
Self::Unhandled(e) => e.meta.request_id(),
}
}
}