aws_sdk_transcribestreaming/
error_meta.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// All possible error types for this service.
3#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6    /// <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 unsupported values. Check the specified parameters and try your request again.</p>
7    BadRequestException(crate::types::error::BadRequestException),
8    /// <p>A new stream started with the same session ID. The current stream has been terminated.</p>
9    ConflictException(crate::types::error::ConflictException),
10    /// <p>A problem occurred while processing the audio. Amazon Transcribe terminated processing.</p>
11    InternalFailureException(crate::types::error::InternalFailureException),
12    /// <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>
13    LimitExceededException(crate::types::error::LimitExceededException),
14    /// <p>The request references a resource which doesn't exist.</p>
15    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
16    /// <p>The service is currently unavailable. Try your request later.</p>
17    ServiceUnavailableException(crate::types::error::ServiceUnavailableException),
18    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
19    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
20    variable wildcard pattern and check `.code()`:
21     \
22    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
23     \
24    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
25    Unhandled(crate::error::sealed_unhandled::Unhandled)
26}
27impl ::std::fmt::Display for Error {
28    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29        match self {
30            Error::BadRequestException(inner) => inner.fmt(f),
31            Error::ConflictException(inner) => inner.fmt(f),
32            Error::InternalFailureException(inner) => inner.fmt(f),
33            Error::LimitExceededException(inner) => inner.fmt(f),
34            Error::ResourceNotFoundException(inner) => inner.fmt(f),
35            Error::ServiceUnavailableException(inner) => inner.fmt(f),
36            Error::Unhandled(_) => if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
37                                        write!(f, "unhandled error ({code})")
38                                    } else {
39                                        f.write_str("unhandled error")
40                                    }
41        }
42    }
43}
44impl From<::aws_smithy_types::error::operation::BuildError> for Error {
45                fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
46                    Error::Unhandled(crate::error::sealed_unhandled::Unhandled { source: value.into(), meta: ::std::default::Default::default() })
47                }
48            }
49impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
50                fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
51                    match self {
52                        Self::BadRequestException(inner) => inner.meta(),
53Self::ConflictException(inner) => inner.meta(),
54Self::InternalFailureException(inner) => inner.meta(),
55Self::LimitExceededException(inner) => inner.meta(),
56Self::ResourceNotFoundException(inner) => inner.meta(),
57Self::ServiceUnavailableException(inner) => inner.meta(),
58                        Self::Unhandled(inner) => &inner.meta,
59                    }
60                }
61            }
62impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
63    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError, R>) -> Self {
64        match err {
65            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
66            _ => Error::Unhandled(
67                                        crate::error::sealed_unhandled::Unhandled {
68                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
69                                            source: err.into(),
70                                        }
71                                    ),
72        }
73    }
74}
75impl From<crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError> for Error {
76    fn from(err: crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError) -> Self {
77        match err {
78            crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError::BadRequestException(inner) => Error::BadRequestException(inner),
79            crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError::InternalFailureException(inner) => Error::InternalFailureException(inner),
80            crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
81            crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
82            crate::operation::get_medical_scribe_stream::GetMedicalScribeStreamError::Unhandled(inner) => Error::Unhandled(inner),
83        }
84    }
85}
86impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
87    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError, R>) -> Self {
88        match err {
89            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
90            _ => Error::Unhandled(
91                                        crate::error::sealed_unhandled::Unhandled {
92                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
93                                            source: err.into(),
94                                        }
95                                    ),
96        }
97    }
98}
99impl From<crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError> for Error {
100    fn from(err: crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError) -> Self {
101        match err {
102            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::BadRequestException(inner) => Error::BadRequestException(inner),
103            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::ConflictException(inner) => Error::ConflictException(inner),
104            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::InternalFailureException(inner) => Error::InternalFailureException(inner),
105            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::LimitExceededException(inner) => Error::LimitExceededException(inner),
106            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
107            crate::operation::start_call_analytics_stream_transcription::StartCallAnalyticsStreamTranscriptionError::Unhandled(inner) => Error::Unhandled(inner),
108        }
109    }
110}
111impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
112    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError, R>) -> Self {
113        match err {
114            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
115            _ => Error::Unhandled(
116                                        crate::error::sealed_unhandled::Unhandled {
117                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
118                                            source: err.into(),
119                                        }
120                                    ),
121        }
122    }
123}
124impl From<crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError> for Error {
125    fn from(err: crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError) -> Self {
126        match err {
127            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::BadRequestException(inner) => Error::BadRequestException(inner),
128            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::ConflictException(inner) => Error::ConflictException(inner),
129            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::InternalFailureException(inner) => Error::InternalFailureException(inner),
130            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
131            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
132            crate::operation::start_medical_scribe_stream::StartMedicalScribeStreamError::Unhandled(inner) => Error::Unhandled(inner),
133        }
134    }
135}
136impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
137    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError, R>) -> Self {
138        match err {
139            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
140            _ => Error::Unhandled(
141                                        crate::error::sealed_unhandled::Unhandled {
142                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
143                                            source: err.into(),
144                                        }
145                                    ),
146        }
147    }
148}
149impl From<crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError> for Error {
150    fn from(err: crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError) -> Self {
151        match err {
152            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::BadRequestException(inner) => Error::BadRequestException(inner),
153            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::ConflictException(inner) => Error::ConflictException(inner),
154            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::InternalFailureException(inner) => Error::InternalFailureException(inner),
155            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::LimitExceededException(inner) => Error::LimitExceededException(inner),
156            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
157            crate::operation::start_medical_stream_transcription::StartMedicalStreamTranscriptionError::Unhandled(inner) => Error::Unhandled(inner),
158        }
159    }
160}
161impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_stream_transcription::StartStreamTranscriptionError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
162    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::start_stream_transcription::StartStreamTranscriptionError, R>) -> Self {
163        match err {
164            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
165            _ => Error::Unhandled(
166                                        crate::error::sealed_unhandled::Unhandled {
167                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
168                                            source: err.into(),
169                                        }
170                                    ),
171        }
172    }
173}
174impl From<crate::operation::start_stream_transcription::StartStreamTranscriptionError> for Error {
175    fn from(err: crate::operation::start_stream_transcription::StartStreamTranscriptionError) -> Self {
176        match err {
177            crate::operation::start_stream_transcription::StartStreamTranscriptionError::BadRequestException(inner) => Error::BadRequestException(inner),
178            crate::operation::start_stream_transcription::StartStreamTranscriptionError::ConflictException(inner) => Error::ConflictException(inner),
179            crate::operation::start_stream_transcription::StartStreamTranscriptionError::InternalFailureException(inner) => Error::InternalFailureException(inner),
180            crate::operation::start_stream_transcription::StartStreamTranscriptionError::LimitExceededException(inner) => Error::LimitExceededException(inner),
181            crate::operation::start_stream_transcription::StartStreamTranscriptionError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
182            crate::operation::start_stream_transcription::StartStreamTranscriptionError::Unhandled(inner) => Error::Unhandled(inner),
183        }
184    }
185}
186impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::AudioStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
187    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::AudioStreamError, R>) -> Self {
188        match err {
189            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
190            _ => Error::Unhandled(
191                                        crate::error::sealed_unhandled::Unhandled {
192                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
193                                            source: err.into(),
194                                        }
195                                    ),
196        }
197    }
198}
199impl From<crate::types::error::AudioStreamError> for Error {
200    fn from(err: crate::types::error::AudioStreamError) -> Self {
201        match err {
202            crate::types::error::AudioStreamError::Unhandled(inner) => Error::Unhandled(inner),
203        }
204    }
205}
206impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::CallAnalyticsTranscriptResultStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
207    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::CallAnalyticsTranscriptResultStreamError, R>) -> Self {
208        match err {
209            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
210            _ => Error::Unhandled(
211                                        crate::error::sealed_unhandled::Unhandled {
212                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
213                                            source: err.into(),
214                                        }
215                                    ),
216        }
217    }
218}
219impl From<crate::types::error::CallAnalyticsTranscriptResultStreamError> for Error {
220    fn from(err: crate::types::error::CallAnalyticsTranscriptResultStreamError) -> Self {
221        match err {
222            crate::types::error::CallAnalyticsTranscriptResultStreamError::BadRequestException(inner) => Error::BadRequestException(inner),
223            crate::types::error::CallAnalyticsTranscriptResultStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
224            crate::types::error::CallAnalyticsTranscriptResultStreamError::InternalFailureException(inner) => Error::InternalFailureException(inner),
225            crate::types::error::CallAnalyticsTranscriptResultStreamError::ConflictException(inner) => Error::ConflictException(inner),
226            crate::types::error::CallAnalyticsTranscriptResultStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
227            crate::types::error::CallAnalyticsTranscriptResultStreamError::Unhandled(inner) => Error::Unhandled(inner),
228        }
229    }
230}
231impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::MedicalScribeInputStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
232    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::MedicalScribeInputStreamError, R>) -> Self {
233        match err {
234            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
235            _ => Error::Unhandled(
236                                        crate::error::sealed_unhandled::Unhandled {
237                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
238                                            source: err.into(),
239                                        }
240                                    ),
241        }
242    }
243}
244impl From<crate::types::error::MedicalScribeInputStreamError> for Error {
245    fn from(err: crate::types::error::MedicalScribeInputStreamError) -> Self {
246        match err {
247            crate::types::error::MedicalScribeInputStreamError::Unhandled(inner) => Error::Unhandled(inner),
248        }
249    }
250}
251impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::MedicalScribeResultStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
252    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::MedicalScribeResultStreamError, R>) -> Self {
253        match err {
254            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
255            _ => Error::Unhandled(
256                                        crate::error::sealed_unhandled::Unhandled {
257                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
258                                            source: err.into(),
259                                        }
260                                    ),
261        }
262    }
263}
264impl From<crate::types::error::MedicalScribeResultStreamError> for Error {
265    fn from(err: crate::types::error::MedicalScribeResultStreamError) -> Self {
266        match err {
267            crate::types::error::MedicalScribeResultStreamError::BadRequestException(inner) => Error::BadRequestException(inner),
268            crate::types::error::MedicalScribeResultStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
269            crate::types::error::MedicalScribeResultStreamError::InternalFailureException(inner) => Error::InternalFailureException(inner),
270            crate::types::error::MedicalScribeResultStreamError::ConflictException(inner) => Error::ConflictException(inner),
271            crate::types::error::MedicalScribeResultStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
272            crate::types::error::MedicalScribeResultStreamError::Unhandled(inner) => Error::Unhandled(inner),
273        }
274    }
275}
276impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::MedicalTranscriptResultStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
277    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::MedicalTranscriptResultStreamError, R>) -> Self {
278        match err {
279            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
280            _ => Error::Unhandled(
281                                        crate::error::sealed_unhandled::Unhandled {
282                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
283                                            source: err.into(),
284                                        }
285                                    ),
286        }
287    }
288}
289impl From<crate::types::error::MedicalTranscriptResultStreamError> for Error {
290    fn from(err: crate::types::error::MedicalTranscriptResultStreamError) -> Self {
291        match err {
292            crate::types::error::MedicalTranscriptResultStreamError::BadRequestException(inner) => Error::BadRequestException(inner),
293            crate::types::error::MedicalTranscriptResultStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
294            crate::types::error::MedicalTranscriptResultStreamError::InternalFailureException(inner) => Error::InternalFailureException(inner),
295            crate::types::error::MedicalTranscriptResultStreamError::ConflictException(inner) => Error::ConflictException(inner),
296            crate::types::error::MedicalTranscriptResultStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
297            crate::types::error::MedicalTranscriptResultStreamError::Unhandled(inner) => Error::Unhandled(inner),
298        }
299    }
300}
301impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::TranscriptResultStreamError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
302    fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::types::error::TranscriptResultStreamError, R>) -> Self {
303        match err {
304            ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
305            _ => Error::Unhandled(
306                                        crate::error::sealed_unhandled::Unhandled {
307                                            meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
308                                            source: err.into(),
309                                        }
310                                    ),
311        }
312    }
313}
314impl From<crate::types::error::TranscriptResultStreamError> for Error {
315    fn from(err: crate::types::error::TranscriptResultStreamError) -> Self {
316        match err {
317            crate::types::error::TranscriptResultStreamError::BadRequestException(inner) => Error::BadRequestException(inner),
318            crate::types::error::TranscriptResultStreamError::LimitExceededException(inner) => Error::LimitExceededException(inner),
319            crate::types::error::TranscriptResultStreamError::InternalFailureException(inner) => Error::InternalFailureException(inner),
320            crate::types::error::TranscriptResultStreamError::ConflictException(inner) => Error::ConflictException(inner),
321            crate::types::error::TranscriptResultStreamError::ServiceUnavailableException(inner) => Error::ServiceUnavailableException(inner),
322            crate::types::error::TranscriptResultStreamError::Unhandled(inner) => Error::Unhandled(inner),
323        }
324    }
325}
326impl ::std::error::Error for Error {
327    fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
328        match self {
329            Error::BadRequestException(inner) => inner.source(),
330            Error::ConflictException(inner) => inner.source(),
331            Error::InternalFailureException(inner) => inner.source(),
332            Error::LimitExceededException(inner) => inner.source(),
333            Error::ResourceNotFoundException(inner) => inner.source(),
334            Error::ServiceUnavailableException(inner) => inner.source(),
335            Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source)
336        }
337    }
338}
339impl ::aws_types::request_id::RequestId for Error {
340    fn request_id(&self) -> Option<&str> {
341        match self {
342            Self::BadRequestException(e) => e.request_id(),
343            Self::ConflictException(e) => e.request_id(),
344            Self::InternalFailureException(e) => e.request_id(),
345            Self::LimitExceededException(e) => e.request_id(),
346            Self::ResourceNotFoundException(e) => e.request_id(),
347            Self::ServiceUnavailableException(e) => e.request_id(),
348            Self::Unhandled(e) => e.meta.request_id(),
349        }
350    }
351}
352