#[non_exhaustive]pub struct GetDistributionConfigError {
pub kind: GetDistributionConfigErrorKind,
/* private fields */
}
Expand description
Error type for the GetDistributionConfig
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: GetDistributionConfigErrorKind
Kind of error that occurred.
Implementations§
source§impl GetDistributionConfigError
impl GetDistributionConfigError
sourcepub fn new(kind: GetDistributionConfigErrorKind, meta: Error) -> Self
pub fn new(kind: GetDistributionConfigErrorKind, meta: Error) -> Self
Creates a new GetDistributionConfigError
.
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 GetDistributionConfigError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 6551)
6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620
pub fn parse_get_distribution_config_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetDistributionConfigOutput,
crate::error::GetDistributionConfigError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::GetDistributionConfigError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetDistributionConfigError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::GetDistributionConfigError {
meta: generic,
kind: crate::error::GetDistributionConfigErrorKind::AccessDenied({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetDistributionConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchDistribution" => {
crate::error::GetDistributionConfigError {
meta: generic,
kind: crate::error::GetDistributionConfigErrorKind::NoSuchDistribution({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_distribution::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_distribution_xml_err(response.body().as_ref(), output).map_err(crate::error::GetDistributionConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::GetDistributionConfigError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_distribution_config_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetDistributionConfigOutput,
crate::error::GetDistributionConfigError,
> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::get_distribution_config_output::Builder::default();
let _ = response;
output = output.set_distribution_config(
crate::http_serde::deser_payload_get_distribution_config_get_distribution_config_output_distribution_config(response.body().as_ref())?
);
output = output.set_e_tag(
crate::http_serde::deser_header_get_distribution_config_get_distribution_config_output_e_tag(response.headers())
.map_err(|_|crate::error::GetDistributionConfigError::unhandled("Failed to parse ETag from header `ETag"))?
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetDistributionConfigError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 6596)
6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598
pub fn parse_get_distribution_config_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetDistributionConfigOutput,
crate::error::GetDistributionConfigError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::GetDistributionConfigError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetDistributionConfigError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::GetDistributionConfigError {
meta: generic,
kind: crate::error::GetDistributionConfigErrorKind::AccessDenied({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetDistributionConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchDistribution" => {
crate::error::GetDistributionConfigError {
meta: generic,
kind: crate::error::GetDistributionConfigErrorKind::NoSuchDistribution({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_distribution::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_no_such_distribution_xml_err(response.body().as_ref(), output).map_err(crate::error::GetDistributionConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::GetDistributionConfigError::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(&self) -> bool
pub fn is_access_denied(&self) -> bool
Returns true
if the error kind is GetDistributionConfigErrorKind::AccessDenied
.
sourcepub fn is_no_such_distribution(&self) -> bool
pub fn is_no_such_distribution(&self) -> bool
Returns true
if the error kind is GetDistributionConfigErrorKind::NoSuchDistribution
.
Trait Implementations§
source§impl Debug for GetDistributionConfigError
impl Debug for GetDistributionConfigError
source§impl Display for GetDistributionConfigError
impl Display for GetDistributionConfigError
source§impl Error for GetDistributionConfigError
impl Error for GetDistributionConfigError
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<GetDistributionConfigError> for Error
impl From<GetDistributionConfigError> for Error
source§fn from(err: GetDistributionConfigError) -> Self
fn from(err: GetDistributionConfigError) -> Self
Converts to this type from the input type.