#[non_exhaustive]pub struct ListWebsiteAuthorizationProvidersError {
pub kind: ListWebsiteAuthorizationProvidersErrorKind,
/* private fields */
}Expand description
Error type for the ListWebsiteAuthorizationProviders operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ListWebsiteAuthorizationProvidersErrorKindKind of error that occurred.
Implementations§
source§impl ListWebsiteAuthorizationProvidersError
impl ListWebsiteAuthorizationProvidersError
sourcepub fn new(kind: ListWebsiteAuthorizationProvidersErrorKind, meta: Error) -> Self
pub fn new(kind: ListWebsiteAuthorizationProvidersErrorKind, meta: Error) -> Self
Creates a new ListWebsiteAuthorizationProvidersError.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the ListWebsiteAuthorizationProvidersError::Unhandled variant from any error type.
Examples found in repository?
2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399
pub fn parse_list_website_authorization_providers_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListWebsiteAuthorizationProvidersOutput,
crate::error::ListWebsiteAuthorizationProvidersError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerErrorException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::InternalServerErrorException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::InvalidRequestException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyRequestsException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::TooManyRequestsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnauthorizedException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::UnauthorizedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::ListWebsiteAuthorizationProvidersError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListWebsiteAuthorizationProvidersError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399
pub fn parse_list_website_authorization_providers_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListWebsiteAuthorizationProvidersOutput,
crate::error::ListWebsiteAuthorizationProvidersError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerErrorException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::InternalServerErrorException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::InvalidRequestException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"TooManyRequestsException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::TooManyRequestsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnauthorizedException" => crate::error::ListWebsiteAuthorizationProvidersError { meta: generic, kind: crate::error::ListWebsiteAuthorizationProvidersErrorKind::UnauthorizedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListWebsiteAuthorizationProvidersError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::ListWebsiteAuthorizationProvidersError::generic(generic)
})
}sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_internal_server_error_exception(&self) -> bool
pub fn is_internal_server_error_exception(&self) -> bool
Returns true if the error kind is ListWebsiteAuthorizationProvidersErrorKind::InternalServerErrorException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is ListWebsiteAuthorizationProvidersErrorKind::InvalidRequestException.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true if the error kind is ListWebsiteAuthorizationProvidersErrorKind::ResourceNotFoundException.
sourcepub fn is_too_many_requests_exception(&self) -> bool
pub fn is_too_many_requests_exception(&self) -> bool
Returns true if the error kind is ListWebsiteAuthorizationProvidersErrorKind::TooManyRequestsException.
Returns true if the error kind is ListWebsiteAuthorizationProvidersErrorKind::UnauthorizedException.