1#[non_exhaustive]
4#[derive(::std::fmt::Debug)]
5pub enum Error {
6 AccessDeniedException(crate::types::error::AccessDeniedException),
8 ConflictException(crate::types::error::ConflictException),
24 InternalServerException(crate::types::error::InternalServerException),
26 ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
28 ServiceQuotaExceededException(crate::types::error::ServiceQuotaExceededException),
30 ValidationException(crate::types::error::ValidationException),
32 #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
34 variable wildcard pattern and check `.code()`:
35 \
36 `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
37 \
38 See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
39 Unhandled(crate::error::sealed_unhandled::Unhandled),
40}
41impl ::std::fmt::Display for Error {
42 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
43 match self {
44 Error::AccessDeniedException(inner) => inner.fmt(f),
45 Error::ConflictException(inner) => inner.fmt(f),
46 Error::InternalServerException(inner) => inner.fmt(f),
47 Error::ResourceNotFoundException(inner) => inner.fmt(f),
48 Error::ServiceQuotaExceededException(inner) => inner.fmt(f),
49 Error::ValidationException(inner) => inner.fmt(f),
50 Error::Unhandled(_) => {
51 if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
52 write!(f, "unhandled error ({code})")
53 } else {
54 f.write_str("unhandled error")
55 }
56 }
57 }
58 }
59}
60impl From<::aws_smithy_types::error::operation::BuildError> for Error {
61 fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
62 Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
63 source: value.into(),
64 meta: ::std::default::Default::default(),
65 })
66 }
67}
68impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
69 fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
70 match self {
71 Self::AccessDeniedException(inner) => inner.meta(),
72 Self::ConflictException(inner) => inner.meta(),
73 Self::InternalServerException(inner) => inner.meta(),
74 Self::ResourceNotFoundException(inner) => inner.meta(),
75 Self::ServiceQuotaExceededException(inner) => inner.meta(),
76 Self::ValidationException(inner) => inner.meta(),
77 Self::Unhandled(inner) => &inner.meta,
78 }
79 }
80}
81impl<R>
82 From<
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
85 R,
86 >,
87 > for Error
88where
89 R: Send + Sync + std::fmt::Debug + 'static,
90{
91 fn from(
92 err: ::aws_smithy_runtime_api::client::result::SdkError<
93 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
94 R,
95 >,
96 ) -> Self {
97 match err {
98 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
99 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
100 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
101 source: err.into(),
102 }),
103 }
104 }
105}
106impl From<crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError> for Error {
107 fn from(err: crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError) -> Self {
108 match err {
109 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError::AccessDeniedException(inner) => {
110 Error::AccessDeniedException(inner)
111 }
112 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError::ConflictException(inner) => {
113 Error::ConflictException(inner)
114 }
115 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError::InternalServerException(inner) => {
116 Error::InternalServerException(inner)
117 }
118 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError::ServiceQuotaExceededException(inner) => {
119 Error::ServiceQuotaExceededException(inner)
120 }
121 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError::ValidationException(inner) => {
122 Error::ValidationException(inner)
123 }
124 crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
125 }
126 }
127}
128impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_account_alias::DeleteAccountAliasError, R>> for Error
129where
130 R: Send + Sync + std::fmt::Debug + 'static,
131{
132 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_account_alias::DeleteAccountAliasError, R>) -> Self {
133 match err {
134 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
135 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
136 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
137 source: err.into(),
138 }),
139 }
140 }
141}
142impl From<crate::operation::delete_account_alias::DeleteAccountAliasError> for Error {
143 fn from(err: crate::operation::delete_account_alias::DeleteAccountAliasError) -> Self {
144 match err {
145 crate::operation::delete_account_alias::DeleteAccountAliasError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
146 crate::operation::delete_account_alias::DeleteAccountAliasError::InternalServerException(inner) => Error::InternalServerException(inner),
147 crate::operation::delete_account_alias::DeleteAccountAliasError::ResourceNotFoundException(inner) => {
148 Error::ResourceNotFoundException(inner)
149 }
150 crate::operation::delete_account_alias::DeleteAccountAliasError::Unhandled(inner) => Error::Unhandled(inner),
151 }
152 }
153}
154impl<R>
155 From<
156 ::aws_smithy_runtime_api::client::result::SdkError<
157 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError,
158 R,
159 >,
160 > for Error
161where
162 R: Send + Sync + std::fmt::Debug + 'static,
163{
164 fn from(
165 err: ::aws_smithy_runtime_api::client::result::SdkError<
166 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError,
167 R,
168 >,
169 ) -> Self {
170 match err {
171 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
172 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
173 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
174 source: err.into(),
175 }),
176 }
177 }
178}
179impl From<crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError> for Error {
180 fn from(err: crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError) -> Self {
181 match err {
182 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError::AccessDeniedException(inner) => {
183 Error::AccessDeniedException(inner)
184 }
185 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError::ConflictException(inner) => {
186 Error::ConflictException(inner)
187 }
188 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError::InternalServerException(inner) => {
189 Error::InternalServerException(inner)
190 }
191 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError::ResourceNotFoundException(inner) => {
192 Error::ResourceNotFoundException(inner)
193 }
194 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError::ValidationException(inner) => {
195 Error::ValidationException(inner)
196 }
197 crate::operation::delete_slack_channel_configuration::DeleteSlackChannelConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
198 }
199 }
200}
201impl<R>
202 From<
203 ::aws_smithy_runtime_api::client::result::SdkError<
204 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError,
205 R,
206 >,
207 > for Error
208where
209 R: Send + Sync + std::fmt::Debug + 'static,
210{
211 fn from(
212 err: ::aws_smithy_runtime_api::client::result::SdkError<
213 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError,
214 R,
215 >,
216 ) -> Self {
217 match err {
218 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
219 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
220 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
221 source: err.into(),
222 }),
223 }
224 }
225}
226impl From<crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError> for Error {
227 fn from(err: crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError) -> Self {
228 match err {
229 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError::AccessDeniedException(inner) => {
230 Error::AccessDeniedException(inner)
231 }
232 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError::ConflictException(inner) => {
233 Error::ConflictException(inner)
234 }
235 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError::InternalServerException(inner) => {
236 Error::InternalServerException(inner)
237 }
238 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError::ResourceNotFoundException(inner) => {
239 Error::ResourceNotFoundException(inner)
240 }
241 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError::ValidationException(inner) => {
242 Error::ValidationException(inner)
243 }
244 crate::operation::delete_slack_workspace_configuration::DeleteSlackWorkspaceConfigurationError::Unhandled(inner) => {
245 Error::Unhandled(inner)
246 }
247 }
248 }
249}
250impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_account_alias::GetAccountAliasError, R>> for Error
251where
252 R: Send + Sync + std::fmt::Debug + 'static,
253{
254 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_account_alias::GetAccountAliasError, R>) -> Self {
255 match err {
256 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
257 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
258 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
259 source: err.into(),
260 }),
261 }
262 }
263}
264impl From<crate::operation::get_account_alias::GetAccountAliasError> for Error {
265 fn from(err: crate::operation::get_account_alias::GetAccountAliasError) -> Self {
266 match err {
267 crate::operation::get_account_alias::GetAccountAliasError::InternalServerException(inner) => Error::InternalServerException(inner),
268 crate::operation::get_account_alias::GetAccountAliasError::Unhandled(inner) => Error::Unhandled(inner),
269 }
270 }
271}
272impl<R>
273 From<
274 ::aws_smithy_runtime_api::client::result::SdkError<
275 crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError,
276 R,
277 >,
278 > for Error
279where
280 R: Send + Sync + std::fmt::Debug + 'static,
281{
282 fn from(
283 err: ::aws_smithy_runtime_api::client::result::SdkError<
284 crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError,
285 R,
286 >,
287 ) -> Self {
288 match err {
289 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
290 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
291 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
292 source: err.into(),
293 }),
294 }
295 }
296}
297impl From<crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError> for Error {
298 fn from(err: crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError) -> Self {
299 match err {
300 crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError::AccessDeniedException(inner) => {
301 Error::AccessDeniedException(inner)
302 }
303 crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError::InternalServerException(inner) => {
304 Error::InternalServerException(inner)
305 }
306 crate::operation::list_slack_channel_configurations::ListSlackChannelConfigurationsError::Unhandled(inner) => Error::Unhandled(inner),
307 }
308 }
309}
310impl<R>
311 From<
312 ::aws_smithy_runtime_api::client::result::SdkError<
313 crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError,
314 R,
315 >,
316 > for Error
317where
318 R: Send + Sync + std::fmt::Debug + 'static,
319{
320 fn from(
321 err: ::aws_smithy_runtime_api::client::result::SdkError<
322 crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError,
323 R,
324 >,
325 ) -> Self {
326 match err {
327 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
328 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
329 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
330 source: err.into(),
331 }),
332 }
333 }
334}
335impl From<crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError> for Error {
336 fn from(err: crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError) -> Self {
337 match err {
338 crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError::AccessDeniedException(inner) => {
339 Error::AccessDeniedException(inner)
340 }
341 crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError::InternalServerException(inner) => {
342 Error::InternalServerException(inner)
343 }
344 crate::operation::list_slack_workspace_configurations::ListSlackWorkspaceConfigurationsError::Unhandled(inner) => Error::Unhandled(inner),
345 }
346 }
347}
348impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_account_alias::PutAccountAliasError, R>> for Error
349where
350 R: Send + Sync + std::fmt::Debug + 'static,
351{
352 fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::put_account_alias::PutAccountAliasError, R>) -> Self {
353 match err {
354 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
355 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
356 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
357 source: err.into(),
358 }),
359 }
360 }
361}
362impl From<crate::operation::put_account_alias::PutAccountAliasError> for Error {
363 fn from(err: crate::operation::put_account_alias::PutAccountAliasError) -> Self {
364 match err {
365 crate::operation::put_account_alias::PutAccountAliasError::AccessDeniedException(inner) => Error::AccessDeniedException(inner),
366 crate::operation::put_account_alias::PutAccountAliasError::InternalServerException(inner) => Error::InternalServerException(inner),
367 crate::operation::put_account_alias::PutAccountAliasError::ValidationException(inner) => Error::ValidationException(inner),
368 crate::operation::put_account_alias::PutAccountAliasError::Unhandled(inner) => Error::Unhandled(inner),
369 }
370 }
371}
372impl<R>
373 From<
374 ::aws_smithy_runtime_api::client::result::SdkError<
375 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError,
376 R,
377 >,
378 > for Error
379where
380 R: Send + Sync + std::fmt::Debug + 'static,
381{
382 fn from(
383 err: ::aws_smithy_runtime_api::client::result::SdkError<
384 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError,
385 R,
386 >,
387 ) -> Self {
388 match err {
389 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
390 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
391 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
392 source: err.into(),
393 }),
394 }
395 }
396}
397impl From<crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError> for Error {
398 fn from(err: crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError) -> Self {
399 match err {
400 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError::AccessDeniedException(inner) => {
401 Error::AccessDeniedException(inner)
402 }
403 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError::ConflictException(inner) => {
404 Error::ConflictException(inner)
405 }
406 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError::InternalServerException(
407 inner,
408 ) => Error::InternalServerException(inner),
409 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError::ResourceNotFoundException(
410 inner,
411 ) => Error::ResourceNotFoundException(inner),
412 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError::ValidationException(inner) => {
413 Error::ValidationException(inner)
414 }
415 crate::operation::register_slack_workspace_for_organization::RegisterSlackWorkspaceForOrganizationError::Unhandled(inner) => {
416 Error::Unhandled(inner)
417 }
418 }
419 }
420}
421impl<R>
422 From<
423 ::aws_smithy_runtime_api::client::result::SdkError<
424 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError,
425 R,
426 >,
427 > for Error
428where
429 R: Send + Sync + std::fmt::Debug + 'static,
430{
431 fn from(
432 err: ::aws_smithy_runtime_api::client::result::SdkError<
433 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError,
434 R,
435 >,
436 ) -> Self {
437 match err {
438 ::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
439 _ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
440 meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
441 source: err.into(),
442 }),
443 }
444 }
445}
446impl From<crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError> for Error {
447 fn from(err: crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError) -> Self {
448 match err {
449 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError::AccessDeniedException(inner) => {
450 Error::AccessDeniedException(inner)
451 }
452 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError::ConflictException(inner) => {
453 Error::ConflictException(inner)
454 }
455 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError::InternalServerException(inner) => {
456 Error::InternalServerException(inner)
457 }
458 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError::ResourceNotFoundException(inner) => {
459 Error::ResourceNotFoundException(inner)
460 }
461 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError::ValidationException(inner) => {
462 Error::ValidationException(inner)
463 }
464 crate::operation::update_slack_channel_configuration::UpdateSlackChannelConfigurationError::Unhandled(inner) => Error::Unhandled(inner),
465 }
466 }
467}
468impl ::std::error::Error for Error {
469 fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
470 match self {
471 Error::AccessDeniedException(inner) => inner.source(),
472 Error::ConflictException(inner) => inner.source(),
473 Error::InternalServerException(inner) => inner.source(),
474 Error::ResourceNotFoundException(inner) => inner.source(),
475 Error::ServiceQuotaExceededException(inner) => inner.source(),
476 Error::ValidationException(inner) => inner.source(),
477 Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
478 }
479 }
480}
481impl ::aws_types::request_id::RequestId for Error {
482 fn request_id(&self) -> Option<&str> {
483 match self {
484 Self::AccessDeniedException(e) => e.request_id(),
485 Self::ConflictException(e) => e.request_id(),
486 Self::InternalServerException(e) => e.request_id(),
487 Self::ResourceNotFoundException(e) => e.request_id(),
488 Self::ServiceQuotaExceededException(e) => e.request_id(),
489 Self::ValidationException(e) => e.request_id(),
490 Self::Unhandled(e) => e.meta.request_id(),
491 }
492 }
493}