aws-sdk-transcribestreaming 0.24.0

AWS SDK for Amazon Transcribe Streaming Service
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 {
    /// <p>One or more arguments to the <code>StartStreamTranscription</code>, <code>StartMedicalStreamTranscription</code>, or <code>StartCallAnalyticsStreamTranscription</code> operation was not valid. For example, <code>MediaEncoding</code> or <code>LanguageCode</code> used not valid values. Check the specified parameters and try your request again.</p>
    BadRequestException(crate::error::BadRequestException),
    /// <p>A new stream started with the same session ID. The current stream has been terminated.</p>
    ConflictException(crate::error::ConflictException),
    /// <p>A problem occurred while processing the audio. Amazon Transcribe terminated processing.</p>
    InternalFailureException(crate::error::InternalFailureException),
    /// <p>Your client has exceeded one of the Amazon Transcribe limits. This is typically the audio length limit. Break your audio stream into smaller chunks and try your request again.</p>
    LimitExceededException(crate::error::LimitExceededException),
    /// <p>The service is currently unavailable. Try your request later.</p>
    ServiceUnavailableException(crate::error::ServiceUnavailableException),
    ///
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
    ///
    /// When logging an error from the SDK, it is recommended that you either wrap the error in
    /// [`DisplayErrorContext`](crate::types::DisplayErrorContext), use another
    /// error reporter library that visits the error's cause/source chain, or call
    /// [`Error::source`](std::error::Error::source) for more details about the underlying cause.
    ///
    Unhandled(crate::error::Unhandled),
}
impl std::fmt::Display for Error {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Error::BadRequestException(inner) => inner.fmt(f),
            Error::ConflictException(inner) => inner.fmt(f),
            Error::InternalFailureException(inner) => inner.fmt(f),
            Error::LimitExceededException(inner) => inner.fmt(f),
            Error::ServiceUnavailableException(inner) => inner.fmt(f),
            Error::Unhandled(inner) => inner.fmt(f),
        }
    }
}
impl<R>
    From<
        aws_smithy_http::result::SdkError<
            crate::error::StartCallAnalyticsStreamTranscriptionError,
            R,
        >,
    > for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<
            crate::error::StartCallAnalyticsStreamTranscriptionError,
            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::StartCallAnalyticsStreamTranscriptionError> for Error {
    fn from(err: crate::error::StartCallAnalyticsStreamTranscriptionError) -> Self {
        match err.kind {
            crate::error::StartCallAnalyticsStreamTranscriptionErrorKind::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
            crate::error::StartCallAnalyticsStreamTranscriptionErrorKind::BadRequestException(inner) => Error::BadRequestException(inner),
            crate::error::StartCallAnalyticsStreamTranscriptionErrorKind::InternalFailureException(inner) => Error::InternalFailureException(inner),
            crate::error::StartCallAnalyticsStreamTranscriptionErrorKind::ConflictException(inner) => Error::ConflictException(inner),
            crate::error::StartCallAnalyticsStreamTranscriptionErrorKind::LimitExceededException(inner) => Error::LimitExceededException(inner),
            crate::error::StartCallAnalyticsStreamTranscriptionErrorKind::Unhandled(inner) => Error::Unhandled(crate::error::Unhandled::new(inner.into())),
        }
    }
}
impl<R>
    From<aws_smithy_http::result::SdkError<crate::error::StartMedicalStreamTranscriptionError, R>>
    for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<
            crate::error::StartMedicalStreamTranscriptionError,
            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::StartMedicalStreamTranscriptionError> for Error {
    fn from(err: crate::error::StartMedicalStreamTranscriptionError) -> Self {
        match err.kind {
            crate::error::StartMedicalStreamTranscriptionErrorKind::ServiceUnavailableException(
                inner,
            ) => Error::ServiceUnavailableException(inner),
            crate::error::StartMedicalStreamTranscriptionErrorKind::BadRequestException(inner) => {
                Error::BadRequestException(inner)
            }
            crate::error::StartMedicalStreamTranscriptionErrorKind::InternalFailureException(
                inner,
            ) => Error::InternalFailureException(inner),
            crate::error::StartMedicalStreamTranscriptionErrorKind::ConflictException(inner) => {
                Error::ConflictException(inner)
            }
            crate::error::StartMedicalStreamTranscriptionErrorKind::LimitExceededException(
                inner,
            ) => Error::LimitExceededException(inner),
            crate::error::StartMedicalStreamTranscriptionErrorKind::Unhandled(inner) => {
                Error::Unhandled(crate::error::Unhandled::new(inner.into()))
            }
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::StartStreamTranscriptionError, R>>
    for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<crate::error::StartStreamTranscriptionError, 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::StartStreamTranscriptionError> for Error {
    fn from(err: crate::error::StartStreamTranscriptionError) -> Self {
        match err.kind {
            crate::error::StartStreamTranscriptionErrorKind::ServiceUnavailableException(inner) => {
                Error::ServiceUnavailableException(inner)
            }
            crate::error::StartStreamTranscriptionErrorKind::BadRequestException(inner) => {
                Error::BadRequestException(inner)
            }
            crate::error::StartStreamTranscriptionErrorKind::InternalFailureException(inner) => {
                Error::InternalFailureException(inner)
            }
            crate::error::StartStreamTranscriptionErrorKind::ConflictException(inner) => {
                Error::ConflictException(inner)
            }
            crate::error::StartStreamTranscriptionErrorKind::LimitExceededException(inner) => {
                Error::LimitExceededException(inner)
            }
            crate::error::StartStreamTranscriptionErrorKind::Unhandled(inner) => {
                Error::Unhandled(crate::error::Unhandled::new(inner.into()))
            }
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::AudioStreamError, R>> for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(err: aws_smithy_http::result::SdkError<crate::error::AudioStreamError, 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::AudioStreamError> for Error {
    fn from(err: crate::error::AudioStreamError) -> Self {
        match err.kind {
            crate::error::AudioStreamErrorKind::Unhandled(inner) => {
                Error::Unhandled(crate::error::Unhandled::new(inner.into()))
            }
        }
    }
}
impl<R>
    From<
        aws_smithy_http::result::SdkError<
            crate::error::CallAnalyticsTranscriptResultStreamError,
            R,
        >,
    > for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<
            crate::error::CallAnalyticsTranscriptResultStreamError,
            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::CallAnalyticsTranscriptResultStreamError> for Error {
    fn from(err: crate::error::CallAnalyticsTranscriptResultStreamError) -> Self {
        match err.kind {
            crate::error::CallAnalyticsTranscriptResultStreamErrorKind::BadRequestException(inner) => Error::BadRequestException(inner),
            crate::error::CallAnalyticsTranscriptResultStreamErrorKind::LimitExceededException(inner) => Error::LimitExceededException(inner),
            crate::error::CallAnalyticsTranscriptResultStreamErrorKind::InternalFailureException(inner) => Error::InternalFailureException(inner),
            crate::error::CallAnalyticsTranscriptResultStreamErrorKind::ConflictException(inner) => Error::ConflictException(inner),
            crate::error::CallAnalyticsTranscriptResultStreamErrorKind::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
            crate::error::CallAnalyticsTranscriptResultStreamErrorKind::Unhandled(inner) => Error::Unhandled(crate::error::Unhandled::new(inner.into())),
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::MedicalTranscriptResultStreamError, R>>
    for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<crate::error::MedicalTranscriptResultStreamError, 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::MedicalTranscriptResultStreamError> for Error {
    fn from(err: crate::error::MedicalTranscriptResultStreamError) -> Self {
        match err.kind {
            crate::error::MedicalTranscriptResultStreamErrorKind::BadRequestException(inner) => {
                Error::BadRequestException(inner)
            }
            crate::error::MedicalTranscriptResultStreamErrorKind::LimitExceededException(inner) => {
                Error::LimitExceededException(inner)
            }
            crate::error::MedicalTranscriptResultStreamErrorKind::InternalFailureException(
                inner,
            ) => Error::InternalFailureException(inner),
            crate::error::MedicalTranscriptResultStreamErrorKind::ConflictException(inner) => {
                Error::ConflictException(inner)
            }
            crate::error::MedicalTranscriptResultStreamErrorKind::ServiceUnavailableException(
                inner,
            ) => Error::ServiceUnavailableException(inner),
            crate::error::MedicalTranscriptResultStreamErrorKind::Unhandled(inner) => {
                Error::Unhandled(crate::error::Unhandled::new(inner.into()))
            }
        }
    }
}
impl<R> From<aws_smithy_http::result::SdkError<crate::error::TranscriptResultStreamError, R>>
    for Error
where
    R: Send + Sync + std::fmt::Debug + 'static,
{
    fn from(
        err: aws_smithy_http::result::SdkError<crate::error::TranscriptResultStreamError, 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::TranscriptResultStreamError> for Error {
    fn from(err: crate::error::TranscriptResultStreamError) -> Self {
        match err.kind {
            crate::error::TranscriptResultStreamErrorKind::BadRequestException(inner) => {
                Error::BadRequestException(inner)
            }
            crate::error::TranscriptResultStreamErrorKind::LimitExceededException(inner) => {
                Error::LimitExceededException(inner)
            }
            crate::error::TranscriptResultStreamErrorKind::InternalFailureException(inner) => {
                Error::InternalFailureException(inner)
            }
            crate::error::TranscriptResultStreamErrorKind::ConflictException(inner) => {
                Error::ConflictException(inner)
            }
            crate::error::TranscriptResultStreamErrorKind::ServiceUnavailableException(inner) => {
                Error::ServiceUnavailableException(inner)
            }
            crate::error::TranscriptResultStreamErrorKind::Unhandled(inner) => {
                Error::Unhandled(crate::error::Unhandled::new(inner.into()))
            }
        }
    }
}
impl std::error::Error for Error {}