Struct aws_sdk_cloudfront::error::ListInvalidationsError
source · #[non_exhaustive]pub struct ListInvalidationsError {
pub kind: ListInvalidationsErrorKind,
/* private fields */
}
Expand description
Error type for the ListInvalidations
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: ListInvalidationsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListInvalidationsError
impl ListInvalidationsError
sourcepub fn new(kind: ListInvalidationsErrorKind, meta: Error) -> Self
pub fn new(kind: ListInvalidationsErrorKind, meta: Error) -> Self
Creates a new ListInvalidationsError
.
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 ListInvalidationsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 9304)
9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373
pub fn parse_list_invalidations_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListInvalidationsOutput, crate::error::ListInvalidationsError>
{
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ListInvalidationsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListInvalidationsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::ListInvalidationsError {
meta: generic,
kind: crate::error::ListInvalidationsErrorKind::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::ListInvalidationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidArgument" => crate::error::ListInvalidationsError {
meta: generic,
kind: crate::error::ListInvalidationsErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::ListInvalidationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchDistribution" => {
crate::error::ListInvalidationsError {
meta: generic,
kind: crate::error::ListInvalidationsErrorKind::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::ListInvalidationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::ListInvalidationsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListInvalidationsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 9371)
9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357 9358 9359 9360 9361 9362 9363 9364 9365 9366 9367 9368 9369 9370 9371 9372 9373
pub fn parse_list_invalidations_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListInvalidationsOutput, crate::error::ListInvalidationsError>
{
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ListInvalidationsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListInvalidationsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDenied" => crate::error::ListInvalidationsError {
meta: generic,
kind: crate::error::ListInvalidationsErrorKind::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::ListInvalidationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidArgument" => crate::error::ListInvalidationsError {
meta: generic,
kind: crate::error::ListInvalidationsErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::ListInvalidationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NoSuchDistribution" => {
crate::error::ListInvalidationsError {
meta: generic,
kind: crate::error::ListInvalidationsErrorKind::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::ListInvalidationsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
_ => crate::error::ListInvalidationsError::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 ListInvalidationsErrorKind::AccessDenied
.
sourcepub fn is_invalid_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true
if the error kind is ListInvalidationsErrorKind::InvalidArgument
.
sourcepub fn is_no_such_distribution(&self) -> bool
pub fn is_no_such_distribution(&self) -> bool
Returns true
if the error kind is ListInvalidationsErrorKind::NoSuchDistribution
.
Trait Implementations§
source§impl Debug for ListInvalidationsError
impl Debug for ListInvalidationsError
source§impl Display for ListInvalidationsError
impl Display for ListInvalidationsError
source§impl Error for ListInvalidationsError
impl Error for ListInvalidationsError
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<ListInvalidationsError> for Error
impl From<ListInvalidationsError> for Error
source§fn from(err: ListInvalidationsError) -> Self
fn from(err: ListInvalidationsError) -> Self
Converts to this type from the input type.