#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
ClientLimitExceededException(crate::types::error::ClientLimitExceededException),
InvalidArgumentException(crate::types::error::InvalidArgumentException),
InvalidCodecPrivateDataException(crate::types::error::InvalidCodecPrivateDataException),
InvalidMediaFrameException(crate::types::error::InvalidMediaFrameException),
MissingCodecPrivateDataException(crate::types::error::MissingCodecPrivateDataException),
NoDataRetentionException(crate::types::error::NoDataRetentionException),
NotAuthorizedException(crate::types::error::NotAuthorizedException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
UnsupportedStreamMediaTypeException(crate::types::error::UnsupportedStreamMediaTypeException),
#[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::ClientLimitExceededException(inner) => inner.fmt(f),
Error::InvalidArgumentException(inner) => inner.fmt(f),
Error::InvalidCodecPrivateDataException(inner) => inner.fmt(f),
Error::InvalidMediaFrameException(inner) => inner.fmt(f),
Error::MissingCodecPrivateDataException(inner) => inner.fmt(f),
Error::NoDataRetentionException(inner) => inner.fmt(f),
Error::NotAuthorizedException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::UnsupportedStreamMediaTypeException(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::ClientLimitExceededException(inner) => inner.meta(),
Self::InvalidArgumentException(inner) => inner.meta(),
Self::InvalidCodecPrivateDataException(inner) => inner.meta(),
Self::InvalidMediaFrameException(inner) => inner.meta(),
Self::MissingCodecPrivateDataException(inner) => inner.meta(),
Self::NoDataRetentionException(inner) => inner.meta(),
Self::NotAuthorizedException(inner) => inner.meta(),
Self::ResourceNotFoundException(inner) => inner.meta(),
Self::UnsupportedStreamMediaTypeException(inner) => inner.meta(),
Self::Unhandled(inner) => &inner.meta,
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_clip::GetClipError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_clip::GetClipError, 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_clip::GetClipError> for Error {
fn from(err: crate::operation::get_clip::GetClipError) -> Self {
match err {
crate::operation::get_clip::GetClipError::ClientLimitExceededException(inner) => Error::ClientLimitExceededException(inner),
crate::operation::get_clip::GetClipError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::get_clip::GetClipError::InvalidCodecPrivateDataException(inner) => Error::InvalidCodecPrivateDataException(inner),
crate::operation::get_clip::GetClipError::InvalidMediaFrameException(inner) => Error::InvalidMediaFrameException(inner),
crate::operation::get_clip::GetClipError::MissingCodecPrivateDataException(inner) => Error::MissingCodecPrivateDataException(inner),
crate::operation::get_clip::GetClipError::NoDataRetentionException(inner) => Error::NoDataRetentionException(inner),
crate::operation::get_clip::GetClipError::NotAuthorizedException(inner) => Error::NotAuthorizedException(inner),
crate::operation::get_clip::GetClipError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_clip::GetClipError::UnsupportedStreamMediaTypeException(inner) => Error::UnsupportedStreamMediaTypeException(inner),
crate::operation::get_clip::GetClipError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError, 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_dash_streaming_session_url::GetDASHStreamingSessionURLError> for Error {
fn from(err: crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError) -> Self {
match err {
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::ClientLimitExceededException(inner) => {
Error::ClientLimitExceededException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::InvalidCodecPrivateDataException(inner) => {
Error::InvalidCodecPrivateDataException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::MissingCodecPrivateDataException(inner) => {
Error::MissingCodecPrivateDataException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::NoDataRetentionException(inner) => {
Error::NoDataRetentionException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::NotAuthorizedException(inner) => {
Error::NotAuthorizedException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::UnsupportedStreamMediaTypeException(inner) => {
Error::UnsupportedStreamMediaTypeException(inner)
}
crate::operation::get_dash_streaming_session_url::GetDASHStreamingSessionURLError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError, 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_hls_streaming_session_url::GetHLSStreamingSessionURLError> for Error {
fn from(err: crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError) -> Self {
match err {
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::ClientLimitExceededException(inner) => {
Error::ClientLimitExceededException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::InvalidCodecPrivateDataException(inner) => {
Error::InvalidCodecPrivateDataException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::MissingCodecPrivateDataException(inner) => {
Error::MissingCodecPrivateDataException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::NoDataRetentionException(inner) => {
Error::NoDataRetentionException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::NotAuthorizedException(inner) => {
Error::NotAuthorizedException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::UnsupportedStreamMediaTypeException(inner) => {
Error::UnsupportedStreamMediaTypeException(inner)
}
crate::operation::get_hls_streaming_session_url::GetHLSStreamingSessionURLError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_images::GetImagesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_images::GetImagesError, 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_images::GetImagesError> for Error {
fn from(err: crate::operation::get_images::GetImagesError) -> Self {
match err {
crate::operation::get_images::GetImagesError::ClientLimitExceededException(inner) => Error::ClientLimitExceededException(inner),
crate::operation::get_images::GetImagesError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::get_images::GetImagesError::NotAuthorizedException(inner) => Error::NotAuthorizedException(inner),
crate::operation::get_images::GetImagesError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_images::GetImagesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError, 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_media_for_fragment_list::GetMediaForFragmentListError> for Error {
fn from(err: crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError) -> Self {
match err {
crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError::ClientLimitExceededException(inner) => {
Error::ClientLimitExceededException(inner)
}
crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError::InvalidArgumentException(inner) => {
Error::InvalidArgumentException(inner)
}
crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError::NotAuthorizedException(inner) => {
Error::NotAuthorizedException(inner)
}
crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::get_media_for_fragment_list::GetMediaForFragmentListError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_fragments::ListFragmentsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_fragments::ListFragmentsError, 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_fragments::ListFragmentsError> for Error {
fn from(err: crate::operation::list_fragments::ListFragmentsError) -> Self {
match err {
crate::operation::list_fragments::ListFragmentsError::ClientLimitExceededException(inner) => Error::ClientLimitExceededException(inner),
crate::operation::list_fragments::ListFragmentsError::InvalidArgumentException(inner) => Error::InvalidArgumentException(inner),
crate::operation::list_fragments::ListFragmentsError::NotAuthorizedException(inner) => Error::NotAuthorizedException(inner),
crate::operation::list_fragments::ListFragmentsError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::list_fragments::ListFragmentsError::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::ClientLimitExceededException(inner) => inner.source(),
Error::InvalidArgumentException(inner) => inner.source(),
Error::InvalidCodecPrivateDataException(inner) => inner.source(),
Error::InvalidMediaFrameException(inner) => inner.source(),
Error::MissingCodecPrivateDataException(inner) => inner.source(),
Error::NoDataRetentionException(inner) => inner.source(),
Error::NotAuthorizedException(inner) => inner.source(),
Error::ResourceNotFoundException(inner) => inner.source(),
Error::UnsupportedStreamMediaTypeException(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::ClientLimitExceededException(e) => e.request_id(),
Self::InvalidArgumentException(e) => e.request_id(),
Self::InvalidCodecPrivateDataException(e) => e.request_id(),
Self::InvalidMediaFrameException(e) => e.request_id(),
Self::MissingCodecPrivateDataException(e) => e.request_id(),
Self::NoDataRetentionException(e) => e.request_id(),
Self::NotAuthorizedException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::UnsupportedStreamMediaTypeException(e) => e.request_id(),
Self::Unhandled(e) => e.meta.request_id(),
}
}
}