1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 InvalidParameterException(crate::types::error::InvalidParameterException),
8 LimitExceededException(crate::types::error::LimitExceededException),
10 ResourceAlreadyExistsException(crate::types::error::ResourceAlreadyExistsException),
12 ResourceInUseException(crate::types::error::ResourceInUseException),
14 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
16 ResourcePreconditionNotMetException(crate::types::error::ResourcePreconditionNotMetException),
18 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
20 variable wildcard pattern and check `.code()`:
21 \
22 `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::InvalidParameterException(inner) => inner.fmt(f),
31 Error::LimitExceededException(inner) => inner.fmt(f),
32 Error::ResourceAlreadyExistsException(inner) => inner.fmt(f),
33 Error::ResourceInUseException(inner) => inner.fmt(f),
34 Error::ResourceNotFoundException(inner) => inner.fmt(f),
35 Error::ResourcePreconditionNotMetException(inner) => inner.fmt(f),
36 Error::Unhandled(_) => {
37 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
38 write!(f, "unhandled error ({code})")
39 } else {
40 f.write_str("unhandled error")
41 }
42 }
43 }
44 }
45}
46impl From<::aws_smithy_types::error::operation::BuildError> for Error {
47 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
48 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
49 source: value.into(),
50 meta: ::std::default::Default::default(),
51 })
52 }
53}
54impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
55 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
56 match self {
57 Self::InvalidParameterException(inner) => inner.meta(),
58 Self::LimitExceededException(inner) => inner.meta(),
59 Self::ResourceAlreadyExistsException(inner) => inner.meta(),
60 Self::ResourceInUseException(inner) => inner.meta(),
61 Self::ResourceNotFoundException(inner) => inner.meta(),
62 Self::ResourcePreconditionNotMetException(inner) => inner.meta(),
63 Self::Unhandled(inner) => &inner.meta,
64 }
65 }
66}
67impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError, R>>
68 for Error
69where
70 R: Send + Sync + std::fmt::Debug + 'static,
71{
72 fn from(
73 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError, R>,
74 ) -> Self {
75 match err {
76 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
77 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
78 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
79 source: err.into(),
80 }),
81 }
82 }
83}
84impl From<crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError> for Error {
85 fn from(err: crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError) -> Self {
86 match err {
87 crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError::InvalidParameterException(inner) => {
88 Error::InvalidParameterException(inner)
89 }
90 crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError::ResourceNotFoundException(inner) => {
91 Error::ResourceNotFoundException(inner)
92 }
93 crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError::ResourcePreconditionNotMetException(inner) => {
94 Error::ResourcePreconditionNotMetException(inner)
95 }
96 crate::operation::cancel_journal_kinesis_stream::CancelJournalKinesisStreamError::Unhandled(inner) => Error::Unhandled(inner),
97 }
98 }
99}
100impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_ledger::CreateLedgerError, R>> for Error
101where
102 R: Send + Sync + std::fmt::Debug + 'static,
103{
104 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_ledger::CreateLedgerError, R>) -> Self {
105 match err {
106 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
107 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
108 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
109 source: err.into(),
110 }),
111 }
112 }
113}
114impl From<crate::operation::create_ledger::CreateLedgerError> for Error {
115 fn from(err: crate::operation::create_ledger::CreateLedgerError) -> Self {
116 match err {
117 crate::operation::create_ledger::CreateLedgerError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
118 crate::operation::create_ledger::CreateLedgerError::LimitExceededException(inner) => Error::LimitExceededException(inner),
119 crate::operation::create_ledger::CreateLedgerError::ResourceAlreadyExistsException(inner) => Error::ResourceAlreadyExistsException(inner),
120 crate::operation::create_ledger::CreateLedgerError::ResourceInUseException(inner) => Error::ResourceInUseException(inner),
121 crate::operation::create_ledger::CreateLedgerError::Unhandled(inner) => Error::Unhandled(inner),
122 }
123 }
124}
125impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_ledger::DeleteLedgerError, R>> for Error
126where
127 R: Send + Sync + std::fmt::Debug + 'static,
128{
129 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_ledger::DeleteLedgerError, R>) -> Self {
130 match err {
131 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
132 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
133 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
134 source: err.into(),
135 }),
136 }
137 }
138}
139impl From<crate::operation::delete_ledger::DeleteLedgerError> for Error {
140 fn from(err: crate::operation::delete_ledger::DeleteLedgerError) -> Self {
141 match err {
142 crate::operation::delete_ledger::DeleteLedgerError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
143 crate::operation::delete_ledger::DeleteLedgerError::ResourceInUseException(inner) => Error::ResourceInUseException(inner),
144 crate::operation::delete_ledger::DeleteLedgerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
145 crate::operation::delete_ledger::DeleteLedgerError::ResourcePreconditionNotMetException(inner) => {
146 Error::ResourcePreconditionNotMetException(inner)
147 }
148 crate::operation::delete_ledger::DeleteLedgerError::Unhandled(inner) => Error::Unhandled(inner),
149 }
150 }
151}
152impl<R>
153 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError, R>>
154 for Error
155where
156 R: Send + Sync + std::fmt::Debug + 'static,
157{
158 fn from(
159 err: ::aws_smithy_runtime_api::client::result::SdkError<
160 crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError,
161 R,
162 >,
163 ) -> Self {
164 match err {
165 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
166 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
167 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
168 source: err.into(),
169 }),
170 }
171 }
172}
173impl From<crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError> for Error {
174 fn from(err: crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError) -> Self {
175 match err {
176 crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError::InvalidParameterException(inner) => {
177 Error::InvalidParameterException(inner)
178 }
179 crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError::ResourceNotFoundException(inner) => {
180 Error::ResourceNotFoundException(inner)
181 }
182 crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError::ResourcePreconditionNotMetException(inner) => {
183 Error::ResourcePreconditionNotMetException(inner)
184 }
185 crate::operation::describe_journal_kinesis_stream::DescribeJournalKinesisStreamError::Unhandled(inner) => Error::Unhandled(inner),
186 }
187 }
188}
189impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_journal_s3_export::DescribeJournalS3ExportError, R>>
190 for Error
191where
192 R: Send + Sync + std::fmt::Debug + 'static,
193{
194 fn from(
195 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_journal_s3_export::DescribeJournalS3ExportError, R>,
196 ) -> Self {
197 match err {
198 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
199 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
200 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
201 source: err.into(),
202 }),
203 }
204 }
205}
206impl From<crate::operation::describe_journal_s3_export::DescribeJournalS3ExportError> for Error {
207 fn from(err: crate::operation::describe_journal_s3_export::DescribeJournalS3ExportError) -> Self {
208 match err {
209 crate::operation::describe_journal_s3_export::DescribeJournalS3ExportError::ResourceNotFoundException(inner) => {
210 Error::ResourceNotFoundException(inner)
211 }
212 crate::operation::describe_journal_s3_export::DescribeJournalS3ExportError::Unhandled(inner) => Error::Unhandled(inner),
213 }
214 }
215}
216impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_ledger::DescribeLedgerError, R>> for Error
217where
218 R: Send + Sync + std::fmt::Debug + 'static,
219{
220 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_ledger::DescribeLedgerError, R>) -> Self {
221 match err {
222 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
223 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
224 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
225 source: err.into(),
226 }),
227 }
228 }
229}
230impl From<crate::operation::describe_ledger::DescribeLedgerError> for Error {
231 fn from(err: crate::operation::describe_ledger::DescribeLedgerError) -> Self {
232 match err {
233 crate::operation::describe_ledger::DescribeLedgerError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
234 crate::operation::describe_ledger::DescribeLedgerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
235 crate::operation::describe_ledger::DescribeLedgerError::Unhandled(inner) => Error::Unhandled(inner),
236 }
237 }
238}
239impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_journal_to_s3::ExportJournalToS3Error, R>> for Error
240where
241 R: Send + Sync + std::fmt::Debug + 'static,
242{
243 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::export_journal_to_s3::ExportJournalToS3Error, R>) -> Self {
244 match err {
245 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
246 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
247 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
248 source: err.into(),
249 }),
250 }
251 }
252}
253impl From<crate::operation::export_journal_to_s3::ExportJournalToS3Error> for Error {
254 fn from(err: crate::operation::export_journal_to_s3::ExportJournalToS3Error) -> Self {
255 match err {
256 crate::operation::export_journal_to_s3::ExportJournalToS3Error::ResourceNotFoundException(inner) => {
257 Error::ResourceNotFoundException(inner)
258 }
259 crate::operation::export_journal_to_s3::ExportJournalToS3Error::ResourcePreconditionNotMetException(inner) => {
260 Error::ResourcePreconditionNotMetException(inner)
261 }
262 crate::operation::export_journal_to_s3::ExportJournalToS3Error::Unhandled(inner) => Error::Unhandled(inner),
263 }
264 }
265}
266impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_block::GetBlockError, R>> for Error
267where
268 R: Send + Sync + std::fmt::Debug + 'static,
269{
270 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_block::GetBlockError, R>) -> Self {
271 match err {
272 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
273 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
274 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
275 source: err.into(),
276 }),
277 }
278 }
279}
280impl From<crate::operation::get_block::GetBlockError> for Error {
281 fn from(err: crate::operation::get_block::GetBlockError) -> Self {
282 match err {
283 crate::operation::get_block::GetBlockError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
284 crate::operation::get_block::GetBlockError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
285 crate::operation::get_block::GetBlockError::ResourcePreconditionNotMetException(inner) => {
286 Error::ResourcePreconditionNotMetException(inner)
287 }
288 crate::operation::get_block::GetBlockError::Unhandled(inner) => Error::Unhandled(inner),
289 }
290 }
291}
292impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_digest::GetDigestError, R>> for Error
293where
294 R: Send + Sync + std::fmt::Debug + 'static,
295{
296 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_digest::GetDigestError, R>) -> Self {
297 match err {
298 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
299 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
300 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
301 source: err.into(),
302 }),
303 }
304 }
305}
306impl From<crate::operation::get_digest::GetDigestError> for Error {
307 fn from(err: crate::operation::get_digest::GetDigestError) -> Self {
308 match err {
309 crate::operation::get_digest::GetDigestError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
310 crate::operation::get_digest::GetDigestError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
311 crate::operation::get_digest::GetDigestError::ResourcePreconditionNotMetException(inner) => {
312 Error::ResourcePreconditionNotMetException(inner)
313 }
314 crate::operation::get_digest::GetDigestError::Unhandled(inner) => Error::Unhandled(inner),
315 }
316 }
317}
318impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_revision::GetRevisionError, R>> for Error
319where
320 R: Send + Sync + std::fmt::Debug + 'static,
321{
322 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_revision::GetRevisionError, R>) -> Self {
323 match err {
324 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
325 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
326 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
327 source: err.into(),
328 }),
329 }
330 }
331}
332impl From<crate::operation::get_revision::GetRevisionError> for Error {
333 fn from(err: crate::operation::get_revision::GetRevisionError) -> Self {
334 match err {
335 crate::operation::get_revision::GetRevisionError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
336 crate::operation::get_revision::GetRevisionError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
337 crate::operation::get_revision::GetRevisionError::ResourcePreconditionNotMetException(inner) => {
338 Error::ResourcePreconditionNotMetException(inner)
339 }
340 crate::operation::get_revision::GetRevisionError::Unhandled(inner) => Error::Unhandled(inner),
341 }
342 }
343}
344impl<R>
345 From<
346 ::aws_smithy_runtime_api::client::result::SdkError<
347 crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError,
348 R,
349 >,
350 > for Error
351where
352 R: Send + Sync + std::fmt::Debug + 'static,
353{
354 fn from(
355 err: ::aws_smithy_runtime_api::client::result::SdkError<
356 crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError,
357 R,
358 >,
359 ) -> Self {
360 match err {
361 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
362 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
363 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
364 source: err.into(),
365 }),
366 }
367 }
368}
369impl From<crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError> for Error {
370 fn from(err: crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError) -> Self {
371 match err {
372 crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
373 crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
374 crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError::ResourcePreconditionNotMetException(inner) => Error::ResourcePreconditionNotMetException(inner),
375 crate::operation::list_journal_kinesis_streams_for_ledger::ListJournalKinesisStreamsForLedgerError::Unhandled(inner) => Error::Unhandled(inner),
376 }
377 }
378}
379impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_journal_s3_exports::ListJournalS3ExportsError, R>> for Error
380where
381 R: Send + Sync + std::fmt::Debug + 'static,
382{
383 fn from(
384 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_journal_s3_exports::ListJournalS3ExportsError, R>,
385 ) -> Self {
386 match err {
387 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
388 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
389 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
390 source: err.into(),
391 }),
392 }
393 }
394}
395impl From<crate::operation::list_journal_s3_exports::ListJournalS3ExportsError> for Error {
396 fn from(err: crate::operation::list_journal_s3_exports::ListJournalS3ExportsError) -> Self {
397 match err {
398 crate::operation::list_journal_s3_exports::ListJournalS3ExportsError::Unhandled(inner) => Error::Unhandled(inner),
399 }
400 }
401}
402impl<R>
403 From<
404 ::aws_smithy_runtime_api::client::result::SdkError<
405 crate::operation::list_journal_s3_exports_for_ledger::ListJournalS3ExportsForLedgerError,
406 R,
407 >,
408 > for Error
409where
410 R: Send + Sync + std::fmt::Debug + 'static,
411{
412 fn from(
413 err: ::aws_smithy_runtime_api::client::result::SdkError<
414 crate::operation::list_journal_s3_exports_for_ledger::ListJournalS3ExportsForLedgerError,
415 R,
416 >,
417 ) -> Self {
418 match err {
419 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
420 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
421 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
422 source: err.into(),
423 }),
424 }
425 }
426}
427impl From<crate::operation::list_journal_s3_exports_for_ledger::ListJournalS3ExportsForLedgerError> for Error {
428 fn from(err: crate::operation::list_journal_s3_exports_for_ledger::ListJournalS3ExportsForLedgerError) -> Self {
429 match err {
430 crate::operation::list_journal_s3_exports_for_ledger::ListJournalS3ExportsForLedgerError::Unhandled(inner) => Error::Unhandled(inner),
431 }
432 }
433}
434impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_ledgers::ListLedgersError, R>> for Error
435where
436 R: Send + Sync + std::fmt::Debug + 'static,
437{
438 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_ledgers::ListLedgersError, R>) -> Self {
439 match err {
440 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
441 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
442 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
443 source: err.into(),
444 }),
445 }
446 }
447}
448impl From<crate::operation::list_ledgers::ListLedgersError> for Error {
449 fn from(err: crate::operation::list_ledgers::ListLedgersError) -> Self {
450 match err {
451 crate::operation::list_ledgers::ListLedgersError::Unhandled(inner) => Error::Unhandled(inner),
452 }
453 }
454}
455impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
456where
457 R: Send + Sync + std::fmt::Debug + 'static,
458{
459 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
460 match err {
461 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
462 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
463 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
464 source: err.into(),
465 }),
466 }
467 }
468}
469impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
470 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
471 match err {
472 crate::operation::list_tags_for_resource::ListTagsForResourceError::InvalidParameterException(inner) => {
473 Error::InvalidParameterException(inner)
474 }
475 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
476 Error::ResourceNotFoundException(inner)
477 }
478 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
479 }
480 }
481}
482impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError, R>>
483 for Error
484where
485 R: Send + Sync + std::fmt::Debug + 'static,
486{
487 fn from(
488 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError, R>,
489 ) -> Self {
490 match err {
491 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
492 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
493 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
494 source: err.into(),
495 }),
496 }
497 }
498}
499impl From<crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError> for Error {
500 fn from(err: crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError) -> Self {
501 match err {
502 crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError::InvalidParameterException(inner) => {
503 Error::InvalidParameterException(inner)
504 }
505 crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError::ResourceNotFoundException(inner) => {
506 Error::ResourceNotFoundException(inner)
507 }
508 crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError::ResourcePreconditionNotMetException(inner) => {
509 Error::ResourcePreconditionNotMetException(inner)
510 }
511 crate::operation::stream_journal_to_kinesis::StreamJournalToKinesisError::Unhandled(inner) => Error::Unhandled(inner),
512 }
513 }
514}
515impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
516where
517 R: Send + Sync + std::fmt::Debug + 'static,
518{
519 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
520 match err {
521 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
522 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
523 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
524 source: err.into(),
525 }),
526 }
527 }
528}
529impl From<crate::operation::tag_resource::TagResourceError> for Error {
530 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
531 match err {
532 crate::operation::tag_resource::TagResourceError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
533 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
534 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
535 }
536 }
537}
538impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
539where
540 R: Send + Sync + std::fmt::Debug + 'static,
541{
542 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
543 match err {
544 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
545 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
546 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
547 source: err.into(),
548 }),
549 }
550 }
551}
552impl From<crate::operation::untag_resource::UntagResourceError> for Error {
553 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
554 match err {
555 crate::operation::untag_resource::UntagResourceError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
556 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
557 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
558 }
559 }
560}
561impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_ledger::UpdateLedgerError, R>> for Error
562where
563 R: Send + Sync + std::fmt::Debug + 'static,
564{
565 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_ledger::UpdateLedgerError, R>) -> Self {
566 match err {
567 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
568 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
569 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
570 source: err.into(),
571 }),
572 }
573 }
574}
575impl From<crate::operation::update_ledger::UpdateLedgerError> for Error {
576 fn from(err: crate::operation::update_ledger::UpdateLedgerError) -> Self {
577 match err {
578 crate::operation::update_ledger::UpdateLedgerError::InvalidParameterException(inner) => Error::InvalidParameterException(inner),
579 crate::operation::update_ledger::UpdateLedgerError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
580 crate::operation::update_ledger::UpdateLedgerError::Unhandled(inner) => Error::Unhandled(inner),
581 }
582 }
583}
584impl<R>
585 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError, R>>
586 for Error
587where
588 R: Send + Sync + std::fmt::Debug + 'static,
589{
590 fn from(
591 err: ::aws_smithy_runtime_api::client::result::SdkError<
592 crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError,
593 R,
594 >,
595 ) -> Self {
596 match err {
597 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
598 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
599 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
600 source: err.into(),
601 }),
602 }
603 }
604}
605impl From<crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError> for Error {
606 fn from(err: crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError) -> Self {
607 match err {
608 crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError::InvalidParameterException(inner) => {
609 Error::InvalidParameterException(inner)
610 }
611 crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError::ResourceNotFoundException(inner) => {
612 Error::ResourceNotFoundException(inner)
613 }
614 crate::operation::update_ledger_permissions_mode::UpdateLedgerPermissionsModeError::Unhandled(inner) => Error::Unhandled(inner),
615 }
616 }
617}
618impl ::std::error::Error for Error {
619 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
620 match self {
621 Error::InvalidParameterException(inner) => inner.source(),
622 Error::LimitExceededException(inner) => inner.source(),
623 Error::ResourceAlreadyExistsException(inner) => inner.source(),
624 Error::ResourceInUseException(inner) => inner.source(),
625 Error::ResourceNotFoundException(inner) => inner.source(),
626 Error::ResourcePreconditionNotMetException(inner) => inner.source(),
627 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
628 }
629 }
630}
631impl ::aws_types::request_id::RequestId for Error {
632 fn request_id(&self) -> Option<&str> {
633 match self {
634 Self::InvalidParameterException(e) => e.request_id(),
635 Self::LimitExceededException(e) => e.request_id(),
636 Self::ResourceAlreadyExistsException(e) => e.request_id(),
637 Self::ResourceInUseException(e) => e.request_id(),
638 Self::ResourceNotFoundException(e) => e.request_id(),
639 Self::ResourcePreconditionNotMetException(e) => e.request_id(),
640 Self::Unhandled(e) => e.meta.request_id(),
641 }
642 }
643}