docktor-api-client 0.35.2

Autogenerated Docktor API client model
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// All possible error types for this service.
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
    /// //////////////////////////////////// Errors //////////////////////////////////// Returned when something critical happened.
    DocktorError(crate::error::DocktorError),
    /// Error coming from Prometheus.
    HealtcheckError(crate::error::HealtcheckError),
    /// Error coming from Prometheus.
    PrometheusError(crate::error::PrometheusError),
    /// Error coming from Systemd.
    SystemdError(crate::error::SystemdError),
    /// An unhandled error occurred.
    Unhandled(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Error::DocktorError(inner) => inner.fmt(f),
            Error::HealtcheckError(inner) => inner.fmt(f),
            Error::PrometheusError(inner) => inner.fmt(f),
            Error::SystemdError(inner) => inner.fmt(f),
            Error::Unhandled(inner) => inner.fmt(f),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::HealthcheckOperationError, R>>
    for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<crate::error::HealthcheckOperationError, R>,
    ) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
                crate::error::HealthcheckOperationErrorKind::HealtcheckError(inner) => {
                    Error::HealtcheckError(inner)
                }
                crate::error::HealthcheckOperationErrorKind::Unhandled(inner) => {
                    Error::Unhandled(inner)
                }
            },
            _ => Error::Unhandled(err.into()),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::ListOperationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: aws_smithy_http::result::SdkError<crate::error::ListOperationError, R>) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
                crate::error::ListOperationErrorKind::Unhandled(inner) => Error::Unhandled(inner),
            },
            _ => Error::Unhandled(err.into()),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::PrometheusTargetOperationError, R>>
    for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<crate::error::PrometheusTargetOperationError, R>,
    ) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
                crate::error::PrometheusTargetOperationErrorKind::DocktorError(inner) => {
                    Error::DocktorError(inner)
                }
                crate::error::PrometheusTargetOperationErrorKind::PrometheusError(inner) => {
                    Error::PrometheusError(inner)
                }
                crate::error::PrometheusTargetOperationErrorKind::Unhandled(inner) => {
                    Error::Unhandled(inner)
                }
            },
            _ => Error::Unhandled(err.into()),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::RestartOperationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<crate::error::RestartOperationError, R>,
    ) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
                crate::error::RestartOperationErrorKind::DocktorError(inner) => {
                    Error::DocktorError(inner)
                }
                crate::error::RestartOperationErrorKind::SystemdError(inner) => {
                    Error::SystemdError(inner)
                }
                crate::error::RestartOperationErrorKind::Unhandled(inner) => {
                    Error::Unhandled(inner)
                }
            },
            _ => Error::Unhandled(err.into()),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::StartOperationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: aws_smithy_http::result::SdkError<crate::error::StartOperationError, R>) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
                crate::error::StartOperationErrorKind::DocktorError(inner) => {
                    Error::DocktorError(inner)
                }
                crate::error::StartOperationErrorKind::SystemdError(inner) => {
                    Error::SystemdError(inner)
                }
                crate::error::StartOperationErrorKind::Unhandled(inner) => Error::Unhandled(inner),
            },
            _ => Error::Unhandled(err.into()),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::StopOperationError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: aws_smithy_http::result::SdkError<crate::error::StopOperationError, R>) -> Self {
        match err {
            aws_smithy_http::result::SdkError::ServiceError { err, .. } => match err.kind {
                crate::error::StopOperationErrorKind::DocktorError(inner) => {
                    Error::DocktorError(inner)
                }
                crate::error::StopOperationErrorKind::SystemdError(inner) => {
                    Error::SystemdError(inner)
                }
                crate::error::StopOperationErrorKind::Unhandled(inner) => Error::Unhandled(inner),
            },
            _ => Error::Unhandled(err.into()),
        }
    }
}
impl std::error::Error for Error {}