1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 ConflictException(crate::types::error::ConflictException),
8 InternalServerException(crate::types::error::InternalServerException),
10 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
12 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
14 ThrottlingException(crate::types::error::ThrottlingException),
16 ValidationException(crate::types::error::ValidationException),
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::ConflictException(inner) => inner.fmt(f),
31 Error::InternalServerException(inner) => inner.fmt(f),
32 Error::ResourceNotFoundException(inner) => inner.fmt(f),
33 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
34 Error::ThrottlingException(inner) => inner.fmt(f),
35 Error::ValidationException(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::ConflictException(inner) => inner.meta(),
58 Self::InternalServerException(inner) => inner.meta(),
59 Self::ResourceNotFoundException(inner) => inner.meta(),
60 Self::ServiceQuotaExceededException(inner) => inner.meta(),
61 Self::ThrottlingException(inner) => inner.meta(),
62 Self::ValidationException(inner) => inner.meta(),
63 Self::Unhandled(inner) => &inner.meta,
64 }
65 }
66}
67impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_notification_channels::AddNotificationChannelsError, 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::add_notification_channels::AddNotificationChannelsError, 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::add_notification_channels::AddNotificationChannelsError> for Error {
85 fn from(err: crate::operation::add_notification_channels::AddNotificationChannelsError) -> Self {
86 match err {
87 crate::operation::add_notification_channels::AddNotificationChannelsError::ConflictException(inner) => Error::ConflictException(inner),
88 crate::operation::add_notification_channels::AddNotificationChannelsError::InternalServerException(inner) => {
89 Error::InternalServerException(inner)
90 }
91 crate::operation::add_notification_channels::AddNotificationChannelsError::ResourceNotFoundException(inner) => {
92 Error::ResourceNotFoundException(inner)
93 }
94 crate::operation::add_notification_channels::AddNotificationChannelsError::ServiceQuotaExceededException(inner) => {
95 Error::ServiceQuotaExceededException(inner)
96 }
97 crate::operation::add_notification_channels::AddNotificationChannelsError::ThrottlingException(inner) => {
98 Error::ThrottlingException(inner)
99 }
100 crate::operation::add_notification_channels::AddNotificationChannelsError::ValidationException(inner) => {
101 Error::ValidationException(inner)
102 }
103 crate::operation::add_notification_channels::AddNotificationChannelsError::Unhandled(inner) => Error::Unhandled(inner),
104 }
105 }
106}
107impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError, R>>
108 for Error
109where
110 R: Send + Sync + std::fmt::Debug + 'static,
111{
112 fn from(
113 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError, R>,
114 ) -> Self {
115 match err {
116 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
117 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
118 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
119 source: err.into(),
120 }),
121 }
122 }
123}
124impl From<crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError> for Error {
125 fn from(err: crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError) -> Self {
126 match err {
127 crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError::InternalServerException(inner) => {
128 Error::InternalServerException(inner)
129 }
130 crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError::ResourceNotFoundException(inner) => {
131 Error::ResourceNotFoundException(inner)
132 }
133 crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError::ThrottlingException(inner) => {
134 Error::ThrottlingException(inner)
135 }
136 crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError::ValidationException(inner) => {
137 Error::ValidationException(inner)
138 }
139 crate::operation::batch_get_frame_metric_data::BatchGetFrameMetricDataError::Unhandled(inner) => Error::Unhandled(inner),
140 }
141 }
142}
143impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::configure_agent::ConfigureAgentError, R>> for Error
144where
145 R: Send + Sync + std::fmt::Debug + 'static,
146{
147 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::configure_agent::ConfigureAgentError, R>) -> Self {
148 match err {
149 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
150 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
151 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
152 source: err.into(),
153 }),
154 }
155 }
156}
157impl From<crate::operation::configure_agent::ConfigureAgentError> for Error {
158 fn from(err: crate::operation::configure_agent::ConfigureAgentError) -> Self {
159 match err {
160 crate::operation::configure_agent::ConfigureAgentError::InternalServerException(inner) => Error::InternalServerException(inner),
161 crate::operation::configure_agent::ConfigureAgentError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
162 crate::operation::configure_agent::ConfigureAgentError::ThrottlingException(inner) => Error::ThrottlingException(inner),
163 crate::operation::configure_agent::ConfigureAgentError::ValidationException(inner) => Error::ValidationException(inner),
164 crate::operation::configure_agent::ConfigureAgentError::Unhandled(inner) => Error::Unhandled(inner),
165 }
166 }
167}
168impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_profiling_group::CreateProfilingGroupError, R>> for Error
169where
170 R: Send + Sync + std::fmt::Debug + 'static,
171{
172 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_profiling_group::CreateProfilingGroupError, R>) -> Self {
173 match err {
174 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
175 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
176 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
177 source: err.into(),
178 }),
179 }
180 }
181}
182impl From<crate::operation::create_profiling_group::CreateProfilingGroupError> for Error {
183 fn from(err: crate::operation::create_profiling_group::CreateProfilingGroupError) -> Self {
184 match err {
185 crate::operation::create_profiling_group::CreateProfilingGroupError::ConflictException(inner) => Error::ConflictException(inner),
186 crate::operation::create_profiling_group::CreateProfilingGroupError::InternalServerException(inner) => {
187 Error::InternalServerException(inner)
188 }
189 crate::operation::create_profiling_group::CreateProfilingGroupError::ServiceQuotaExceededException(inner) => {
190 Error::ServiceQuotaExceededException(inner)
191 }
192 crate::operation::create_profiling_group::CreateProfilingGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
193 crate::operation::create_profiling_group::CreateProfilingGroupError::ValidationException(inner) => Error::ValidationException(inner),
194 crate::operation::create_profiling_group::CreateProfilingGroupError::Unhandled(inner) => Error::Unhandled(inner),
195 }
196 }
197}
198impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_profiling_group::DeleteProfilingGroupError, R>> for Error
199where
200 R: Send + Sync + std::fmt::Debug + 'static,
201{
202 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_profiling_group::DeleteProfilingGroupError, R>) -> Self {
203 match err {
204 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
205 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
206 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
207 source: err.into(),
208 }),
209 }
210 }
211}
212impl From<crate::operation::delete_profiling_group::DeleteProfilingGroupError> for Error {
213 fn from(err: crate::operation::delete_profiling_group::DeleteProfilingGroupError) -> Self {
214 match err {
215 crate::operation::delete_profiling_group::DeleteProfilingGroupError::ConflictException(inner) => Error::ConflictException(inner),
216 crate::operation::delete_profiling_group::DeleteProfilingGroupError::InternalServerException(inner) => {
217 Error::InternalServerException(inner)
218 }
219 crate::operation::delete_profiling_group::DeleteProfilingGroupError::ResourceNotFoundException(inner) => {
220 Error::ResourceNotFoundException(inner)
221 }
222 crate::operation::delete_profiling_group::DeleteProfilingGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
223 crate::operation::delete_profiling_group::DeleteProfilingGroupError::ValidationException(inner) => Error::ValidationException(inner),
224 crate::operation::delete_profiling_group::DeleteProfilingGroupError::Unhandled(inner) => Error::Unhandled(inner),
225 }
226 }
227}
228impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_profiling_group::DescribeProfilingGroupError, R>> for Error
229where
230 R: Send + Sync + std::fmt::Debug + 'static,
231{
232 fn from(
233 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_profiling_group::DescribeProfilingGroupError, R>,
234 ) -> Self {
235 match err {
236 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
237 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
238 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
239 source: err.into(),
240 }),
241 }
242 }
243}
244impl From<crate::operation::describe_profiling_group::DescribeProfilingGroupError> for Error {
245 fn from(err: crate::operation::describe_profiling_group::DescribeProfilingGroupError) -> Self {
246 match err {
247 crate::operation::describe_profiling_group::DescribeProfilingGroupError::InternalServerException(inner) => {
248 Error::InternalServerException(inner)
249 }
250 crate::operation::describe_profiling_group::DescribeProfilingGroupError::ResourceNotFoundException(inner) => {
251 Error::ResourceNotFoundException(inner)
252 }
253 crate::operation::describe_profiling_group::DescribeProfilingGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
254 crate::operation::describe_profiling_group::DescribeProfilingGroupError::ValidationException(inner) => Error::ValidationException(inner),
255 crate::operation::describe_profiling_group::DescribeProfilingGroupError::Unhandled(inner) => Error::Unhandled(inner),
256 }
257 }
258}
259impl<R>
260 From<
261 ::aws_smithy_runtime_api::client::result::SdkError<
262 crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError,
263 R,
264 >,
265 > for Error
266where
267 R: Send + Sync + std::fmt::Debug + 'static,
268{
269 fn from(
270 err: ::aws_smithy_runtime_api::client::result::SdkError<
271 crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError,
272 R,
273 >,
274 ) -> Self {
275 match err {
276 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
277 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
278 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
279 source: err.into(),
280 }),
281 }
282 }
283}
284impl From<crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError> for Error {
285 fn from(err: crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError) -> Self {
286 match err {
287 crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError::InternalServerException(inner) => {
288 Error::InternalServerException(inner)
289 }
290 crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError::ThrottlingException(inner) => {
291 Error::ThrottlingException(inner)
292 }
293 crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError::ValidationException(inner) => {
294 Error::ValidationException(inner)
295 }
296 crate::operation::get_findings_report_account_summary::GetFindingsReportAccountSummaryError::Unhandled(inner) => Error::Unhandled(inner),
297 }
298 }
299}
300impl<R>
301 From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_notification_configuration::GetNotificationConfigurationError, R>>
302 for Error
303where
304 R: Send + Sync + std::fmt::Debug + 'static,
305{
306 fn from(
307 err: ::aws_smithy_runtime_api::client::result::SdkError<
308 crate::operation::get_notification_configuration::GetNotificationConfigurationError,
309 R,
310 >,
311 ) -> Self {
312 match err {
313 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
314 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
315 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
316 source: err.into(),
317 }),
318 }
319 }
320}
321impl From<crate::operation::get_notification_configuration::GetNotificationConfigurationError> for Error {
322 fn from(err: crate::operation::get_notification_configuration::GetNotificationConfigurationError) -> Self {
323 match err {
324 crate::operation::get_notification_configuration::GetNotificationConfigurationError::InternalServerException(inner) => {
325 Error::InternalServerException(inner)
326 }
327 crate::operation::get_notification_configuration::GetNotificationConfigurationError::ResourceNotFoundException(inner) => {
328 Error::ResourceNotFoundException(inner)
329 }
330 crate::operation::get_notification_configuration::GetNotificationConfigurationError::ThrottlingException(inner) => {
331 Error::ThrottlingException(inner)
332 }
333 crate::operation::get_notification_configuration::GetNotificationConfigurationError::ValidationException(inner) => {
334 Error::ValidationException(inner)
335 }
336 crate::operation::get_notification_configuration::GetNotificationConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
337 }
338 }
339}
340impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_policy::GetPolicyError, R>> for Error
341where
342 R: Send + Sync + std::fmt::Debug + 'static,
343{
344 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_policy::GetPolicyError, R>) -> Self {
345 match err {
346 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
347 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
348 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
349 source: err.into(),
350 }),
351 }
352 }
353}
354impl From<crate::operation::get_policy::GetPolicyError> for Error {
355 fn from(err: crate::operation::get_policy::GetPolicyError) -> Self {
356 match err {
357 crate::operation::get_policy::GetPolicyError::InternalServerException(inner) => Error::InternalServerException(inner),
358 crate::operation::get_policy::GetPolicyError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
359 crate::operation::get_policy::GetPolicyError::ThrottlingException(inner) => Error::ThrottlingException(inner),
360 crate::operation::get_policy::GetPolicyError::Unhandled(inner) => Error::Unhandled(inner),
361 }
362 }
363}
364impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile::GetProfileError, R>> for Error
365where
366 R: Send + Sync + std::fmt::Debug + 'static,
367{
368 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_profile::GetProfileError, R>) -> Self {
369 match err {
370 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
371 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
372 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
373 source: err.into(),
374 }),
375 }
376 }
377}
378impl From<crate::operation::get_profile::GetProfileError> for Error {
379 fn from(err: crate::operation::get_profile::GetProfileError) -> Self {
380 match err {
381 crate::operation::get_profile::GetProfileError::InternalServerException(inner) => Error::InternalServerException(inner),
382 crate::operation::get_profile::GetProfileError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
383 crate::operation::get_profile::GetProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
384 crate::operation::get_profile::GetProfileError::ValidationException(inner) => Error::ValidationException(inner),
385 crate::operation::get_profile::GetProfileError::Unhandled(inner) => Error::Unhandled(inner),
386 }
387 }
388}
389impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_recommendations::GetRecommendationsError, R>> for Error
390where
391 R: Send + Sync + std::fmt::Debug + 'static,
392{
393 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_recommendations::GetRecommendationsError, R>) -> Self {
394 match err {
395 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
396 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
397 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
398 source: err.into(),
399 }),
400 }
401 }
402}
403impl From<crate::operation::get_recommendations::GetRecommendationsError> for Error {
404 fn from(err: crate::operation::get_recommendations::GetRecommendationsError) -> Self {
405 match err {
406 crate::operation::get_recommendations::GetRecommendationsError::InternalServerException(inner) => Error::InternalServerException(inner),
407 crate::operation::get_recommendations::GetRecommendationsError::ResourceNotFoundException(inner) => {
408 Error::ResourceNotFoundException(inner)
409 }
410 crate::operation::get_recommendations::GetRecommendationsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
411 crate::operation::get_recommendations::GetRecommendationsError::ValidationException(inner) => Error::ValidationException(inner),
412 crate::operation::get_recommendations::GetRecommendationsError::Unhandled(inner) => Error::Unhandled(inner),
413 }
414 }
415}
416impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_findings_reports::ListFindingsReportsError, R>> for Error
417where
418 R: Send + Sync + std::fmt::Debug + 'static,
419{
420 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_findings_reports::ListFindingsReportsError, R>) -> Self {
421 match err {
422 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
423 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
424 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
425 source: err.into(),
426 }),
427 }
428 }
429}
430impl From<crate::operation::list_findings_reports::ListFindingsReportsError> for Error {
431 fn from(err: crate::operation::list_findings_reports::ListFindingsReportsError) -> Self {
432 match err {
433 crate::operation::list_findings_reports::ListFindingsReportsError::InternalServerException(inner) => {
434 Error::InternalServerException(inner)
435 }
436 crate::operation::list_findings_reports::ListFindingsReportsError::ResourceNotFoundException(inner) => {
437 Error::ResourceNotFoundException(inner)
438 }
439 crate::operation::list_findings_reports::ListFindingsReportsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
440 crate::operation::list_findings_reports::ListFindingsReportsError::ValidationException(inner) => Error::ValidationException(inner),
441 crate::operation::list_findings_reports::ListFindingsReportsError::Unhandled(inner) => Error::Unhandled(inner),
442 }
443 }
444}
445impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profile_times::ListProfileTimesError, R>> for Error
446where
447 R: Send + Sync + std::fmt::Debug + 'static,
448{
449 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profile_times::ListProfileTimesError, R>) -> Self {
450 match err {
451 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
452 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
453 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
454 source: err.into(),
455 }),
456 }
457 }
458}
459impl From<crate::operation::list_profile_times::ListProfileTimesError> for Error {
460 fn from(err: crate::operation::list_profile_times::ListProfileTimesError) -> Self {
461 match err {
462 crate::operation::list_profile_times::ListProfileTimesError::InternalServerException(inner) => Error::InternalServerException(inner),
463 crate::operation::list_profile_times::ListProfileTimesError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
464 crate::operation::list_profile_times::ListProfileTimesError::ThrottlingException(inner) => Error::ThrottlingException(inner),
465 crate::operation::list_profile_times::ListProfileTimesError::ValidationException(inner) => Error::ValidationException(inner),
466 crate::operation::list_profile_times::ListProfileTimesError::Unhandled(inner) => Error::Unhandled(inner),
467 }
468 }
469}
470impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profiling_groups::ListProfilingGroupsError, R>> for Error
471where
472 R: Send + Sync + std::fmt::Debug + 'static,
473{
474 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_profiling_groups::ListProfilingGroupsError, R>) -> Self {
475 match err {
476 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
477 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
478 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
479 source: err.into(),
480 }),
481 }
482 }
483}
484impl From<crate::operation::list_profiling_groups::ListProfilingGroupsError> for Error {
485 fn from(err: crate::operation::list_profiling_groups::ListProfilingGroupsError) -> Self {
486 match err {
487 crate::operation::list_profiling_groups::ListProfilingGroupsError::InternalServerException(inner) => {
488 Error::InternalServerException(inner)
489 }
490 crate::operation::list_profiling_groups::ListProfilingGroupsError::ThrottlingException(inner) => Error::ThrottlingException(inner),
491 crate::operation::list_profiling_groups::ListProfilingGroupsError::Unhandled(inner) => Error::Unhandled(inner),
492 }
493 }
494}
495impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>> for Error
496where
497 R: Send + Sync + std::fmt::Debug + 'static,
498{
499 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
500 match err {
501 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
502 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
503 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
504 source: err.into(),
505 }),
506 }
507 }
508}
509impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
510 fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
511 match err {
512 crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalServerException(inner) => {
513 Error::InternalServerException(inner)
514 }
515 crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => {
516 Error::ResourceNotFoundException(inner)
517 }
518 crate::operation::list_tags_for_resource::ListTagsForResourceError::ValidationException(inner) => Error::ValidationException(inner),
519 crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
520 }
521 }
522}
523impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::post_agent_profile::PostAgentProfileError, R>> for Error
524where
525 R: Send + Sync + std::fmt::Debug + 'static,
526{
527 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::post_agent_profile::PostAgentProfileError, R>) -> Self {
528 match err {
529 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
530 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
531 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
532 source: err.into(),
533 }),
534 }
535 }
536}
537impl From<crate::operation::post_agent_profile::PostAgentProfileError> for Error {
538 fn from(err: crate::operation::post_agent_profile::PostAgentProfileError) -> Self {
539 match err {
540 crate::operation::post_agent_profile::PostAgentProfileError::InternalServerException(inner) => Error::InternalServerException(inner),
541 crate::operation::post_agent_profile::PostAgentProfileError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
542 crate::operation::post_agent_profile::PostAgentProfileError::ThrottlingException(inner) => Error::ThrottlingException(inner),
543 crate::operation::post_agent_profile::PostAgentProfileError::ValidationException(inner) => Error::ValidationException(inner),
544 crate::operation::post_agent_profile::PostAgentProfileError::Unhandled(inner) => Error::Unhandled(inner),
545 }
546 }
547}
548impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_permission::PutPermissionError, R>> for Error
549where
550 R: Send + Sync + std::fmt::Debug + 'static,
551{
552 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_permission::PutPermissionError, R>) -> Self {
553 match err {
554 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
555 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
556 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
557 source: err.into(),
558 }),
559 }
560 }
561}
562impl From<crate::operation::put_permission::PutPermissionError> for Error {
563 fn from(err: crate::operation::put_permission::PutPermissionError) -> Self {
564 match err {
565 crate::operation::put_permission::PutPermissionError::ConflictException(inner) => Error::ConflictException(inner),
566 crate::operation::put_permission::PutPermissionError::InternalServerException(inner) => Error::InternalServerException(inner),
567 crate::operation::put_permission::PutPermissionError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
568 crate::operation::put_permission::PutPermissionError::ThrottlingException(inner) => Error::ThrottlingException(inner),
569 crate::operation::put_permission::PutPermissionError::ValidationException(inner) => Error::ValidationException(inner),
570 crate::operation::put_permission::PutPermissionError::Unhandled(inner) => Error::Unhandled(inner),
571 }
572 }
573}
574impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_notification_channel::RemoveNotificationChannelError, R>>
575 for Error
576where
577 R: Send + Sync + std::fmt::Debug + 'static,
578{
579 fn from(
580 err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_notification_channel::RemoveNotificationChannelError, R>,
581 ) -> Self {
582 match err {
583 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
584 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
585 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
586 source: err.into(),
587 }),
588 }
589 }
590}
591impl From<crate::operation::remove_notification_channel::RemoveNotificationChannelError> for Error {
592 fn from(err: crate::operation::remove_notification_channel::RemoveNotificationChannelError) -> Self {
593 match err {
594 crate::operation::remove_notification_channel::RemoveNotificationChannelError::InternalServerException(inner) => {
595 Error::InternalServerException(inner)
596 }
597 crate::operation::remove_notification_channel::RemoveNotificationChannelError::ResourceNotFoundException(inner) => {
598 Error::ResourceNotFoundException(inner)
599 }
600 crate::operation::remove_notification_channel::RemoveNotificationChannelError::ThrottlingException(inner) => {
601 Error::ThrottlingException(inner)
602 }
603 crate::operation::remove_notification_channel::RemoveNotificationChannelError::ValidationException(inner) => {
604 Error::ValidationException(inner)
605 }
606 crate::operation::remove_notification_channel::RemoveNotificationChannelError::Unhandled(inner) => Error::Unhandled(inner),
607 }
608 }
609}
610impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_permission::RemovePermissionError, R>> for Error
611where
612 R: Send + Sync + std::fmt::Debug + 'static,
613{
614 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_permission::RemovePermissionError, R>) -> Self {
615 match err {
616 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
617 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
618 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
619 source: err.into(),
620 }),
621 }
622 }
623}
624impl From<crate::operation::remove_permission::RemovePermissionError> for Error {
625 fn from(err: crate::operation::remove_permission::RemovePermissionError) -> Self {
626 match err {
627 crate::operation::remove_permission::RemovePermissionError::ConflictException(inner) => Error::ConflictException(inner),
628 crate::operation::remove_permission::RemovePermissionError::InternalServerException(inner) => Error::InternalServerException(inner),
629 crate::operation::remove_permission::RemovePermissionError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
630 crate::operation::remove_permission::RemovePermissionError::ThrottlingException(inner) => Error::ThrottlingException(inner),
631 crate::operation::remove_permission::RemovePermissionError::ValidationException(inner) => Error::ValidationException(inner),
632 crate::operation::remove_permission::RemovePermissionError::Unhandled(inner) => Error::Unhandled(inner),
633 }
634 }
635}
636impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::submit_feedback::SubmitFeedbackError, R>> for Error
637where
638 R: Send + Sync + std::fmt::Debug + 'static,
639{
640 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::submit_feedback::SubmitFeedbackError, R>) -> Self {
641 match err {
642 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
643 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
644 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
645 source: err.into(),
646 }),
647 }
648 }
649}
650impl From<crate::operation::submit_feedback::SubmitFeedbackError> for Error {
651 fn from(err: crate::operation::submit_feedback::SubmitFeedbackError) -> Self {
652 match err {
653 crate::operation::submit_feedback::SubmitFeedbackError::InternalServerException(inner) => Error::InternalServerException(inner),
654 crate::operation::submit_feedback::SubmitFeedbackError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
655 crate::operation::submit_feedback::SubmitFeedbackError::ThrottlingException(inner) => Error::ThrottlingException(inner),
656 crate::operation::submit_feedback::SubmitFeedbackError::ValidationException(inner) => Error::ValidationException(inner),
657 crate::operation::submit_feedback::SubmitFeedbackError::Unhandled(inner) => Error::Unhandled(inner),
658 }
659 }
660}
661impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>> for Error
662where
663 R: Send + Sync + std::fmt::Debug + 'static,
664{
665 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::tag_resource::TagResourceError, R>) -> Self {
666 match err {
667 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
668 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
669 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
670 source: err.into(),
671 }),
672 }
673 }
674}
675impl From<crate::operation::tag_resource::TagResourceError> for Error {
676 fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
677 match err {
678 crate::operation::tag_resource::TagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
679 crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
680 crate::operation::tag_resource::TagResourceError::ValidationException(inner) => Error::ValidationException(inner),
681 crate::operation::tag_resource::TagResourceError::Unhandled(inner) => Error::Unhandled(inner),
682 }
683 }
684}
685impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>> for Error
686where
687 R: Send + Sync + std::fmt::Debug + 'static,
688{
689 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>) -> Self {
690 match err {
691 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
692 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
693 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
694 source: err.into(),
695 }),
696 }
697 }
698}
699impl From<crate::operation::untag_resource::UntagResourceError> for Error {
700 fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
701 match err {
702 crate::operation::untag_resource::UntagResourceError::InternalServerException(inner) => Error::InternalServerException(inner),
703 crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
704 crate::operation::untag_resource::UntagResourceError::ValidationException(inner) => Error::ValidationException(inner),
705 crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => Error::Unhandled(inner),
706 }
707 }
708}
709impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_profiling_group::UpdateProfilingGroupError, R>> for Error
710where
711 R: Send + Sync + std::fmt::Debug + 'static,
712{
713 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_profiling_group::UpdateProfilingGroupError, R>) -> Self {
714 match err {
715 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
716 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
717 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
718 source: err.into(),
719 }),
720 }
721 }
722}
723impl From<crate::operation::update_profiling_group::UpdateProfilingGroupError> for Error {
724 fn from(err: crate::operation::update_profiling_group::UpdateProfilingGroupError) -> Self {
725 match err {
726 crate::operation::update_profiling_group::UpdateProfilingGroupError::ConflictException(inner) => Error::ConflictException(inner),
727 crate::operation::update_profiling_group::UpdateProfilingGroupError::InternalServerException(inner) => {
728 Error::InternalServerException(inner)
729 }
730 crate::operation::update_profiling_group::UpdateProfilingGroupError::ResourceNotFoundException(inner) => {
731 Error::ResourceNotFoundException(inner)
732 }
733 crate::operation::update_profiling_group::UpdateProfilingGroupError::ThrottlingException(inner) => Error::ThrottlingException(inner),
734 crate::operation::update_profiling_group::UpdateProfilingGroupError::ValidationException(inner) => Error::ValidationException(inner),
735 crate::operation::update_profiling_group::UpdateProfilingGroupError::Unhandled(inner) => Error::Unhandled(inner),
736 }
737 }
738}
739impl ::std::error::Error for Error {
740 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
741 match self {
742 Error::ConflictException(inner) => inner.source(),
743 Error::InternalServerException(inner) => inner.source(),
744 Error::ResourceNotFoundException(inner) => inner.source(),
745 Error::ServiceQuotaExceededException(inner) => inner.source(),
746 Error::ThrottlingException(inner) => inner.source(),
747 Error::ValidationException(inner) => inner.source(),
748 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
749 }
750 }
751}
752impl ::aws_types::request_id::RequestId for Error {
753 fn request_id(&self) -> Option<&str> {
754 match self {
755 Self::ConflictException(e) => e.request_id(),
756 Self::InternalServerException(e) => e.request_id(),
757 Self::ResourceNotFoundException(e) => e.request_id(),
758 Self::ServiceQuotaExceededException(e) => e.request_id(),
759 Self::ThrottlingException(e) => e.request_id(),
760 Self::ValidationException(e) => e.request_id(),
761 Self::Unhandled(e) => e.meta.request_id(),
762 }
763 }
764}