Struct aws_sdk_workspacesweb::error::ListTrustStoresError
source · #[non_exhaustive]pub struct ListTrustStoresError {
pub kind: ListTrustStoresErrorKind,
/* private fields */
}
Expand description
Error type for the ListTrustStores
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: ListTrustStoresErrorKind
Kind of error that occurred.
Implementations§
source§impl ListTrustStoresError
impl ListTrustStoresError
sourcepub fn new(kind: ListTrustStoresErrorKind, meta: Error) -> Self
pub fn new(kind: ListTrustStoresErrorKind, meta: Error) -> Self
Creates a new ListTrustStoresError
.
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 ListTrustStoresError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 4656)
4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739
pub fn parse_list_trust_stores_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListTrustStoresOutput, crate::error::ListTrustStoresError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListTrustStoresError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListTrustStoresError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::AccessDeniedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_trust_stores_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListTrustStoresError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::ThrottlingException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_trust_stores_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListTrustStoresError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::ValidationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListTrustStoresError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListTrustStoresError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 4737)
4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739
pub fn parse_list_trust_stores_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListTrustStoresOutput, crate::error::ListTrustStoresError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListTrustStoresError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListTrustStoresError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::AccessDeniedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_trust_stores_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListTrustStoresError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::ThrottlingException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_trust_stores_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListTrustStoresError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::ListTrustStoresError {
meta: generic,
kind: crate::error::ListTrustStoresErrorKind::ValidationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTrustStoresError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListTrustStoresError::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_access_denied_exception(&self) -> bool
pub fn is_access_denied_exception(&self) -> bool
Returns true
if the error kind is ListTrustStoresErrorKind::AccessDeniedException
.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true
if the error kind is ListTrustStoresErrorKind::InternalServerException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is ListTrustStoresErrorKind::ThrottlingException
.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true
if the error kind is ListTrustStoresErrorKind::ValidationException
.
Trait Implementations§
source§impl Debug for ListTrustStoresError
impl Debug for ListTrustStoresError
source§impl Display for ListTrustStoresError
impl Display for ListTrustStoresError
source§impl Error for ListTrustStoresError
impl Error for ListTrustStoresError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<ListTrustStoresError> for Error
impl From<ListTrustStoresError> for Error
source§fn from(err: ListTrustStoresError) -> Self
fn from(err: ListTrustStoresError) -> Self
Converts to this type from the input type.