Struct aws_sdk_iot::error::ListDimensionsError
source · #[non_exhaustive]pub struct ListDimensionsError {
pub kind: ListDimensionsErrorKind,
/* private fields */
}
Expand description
Error type for the ListDimensions
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: ListDimensionsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListDimensionsError
impl ListDimensionsError
sourcepub fn new(kind: ListDimensionsErrorKind, meta: Error) -> Self
pub fn new(kind: ListDimensionsErrorKind, meta: Error) -> Self
Creates a new ListDimensionsError
.
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 ListDimensionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 18544)
18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602
pub fn parse_list_dimensions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListDimensionsOutput, crate::error::ListDimensionsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListDimensionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListDimensionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::ListDimensionsError {
meta: generic,
kind: crate::error::ListDimensionsErrorKind::InternalFailureException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListDimensionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::ListDimensionsError {
meta: generic,
kind: crate::error::ListDimensionsErrorKind::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::ListDimensionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListDimensionsError {
meta: generic,
kind: crate::error::ListDimensionsErrorKind::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::ListDimensionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListDimensionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListDimensionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 18600)
18537 18538 18539 18540 18541 18542 18543 18544 18545 18546 18547 18548 18549 18550 18551 18552 18553 18554 18555 18556 18557 18558 18559 18560 18561 18562 18563 18564 18565 18566 18567 18568 18569 18570 18571 18572 18573 18574 18575 18576 18577 18578 18579 18580 18581 18582 18583 18584 18585 18586 18587 18588 18589 18590 18591 18592 18593 18594 18595 18596 18597 18598 18599 18600 18601 18602
pub fn parse_list_dimensions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListDimensionsOutput, crate::error::ListDimensionsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListDimensionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListDimensionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::ListDimensionsError {
meta: generic,
kind: crate::error::ListDimensionsErrorKind::InternalFailureException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListDimensionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::ListDimensionsError {
meta: generic,
kind: crate::error::ListDimensionsErrorKind::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::ListDimensionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListDimensionsError {
meta: generic,
kind: crate::error::ListDimensionsErrorKind::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::ListDimensionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListDimensionsError::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_failure_exception(&self) -> bool
pub fn is_internal_failure_exception(&self) -> bool
Returns true
if the error kind is ListDimensionsErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is ListDimensionsErrorKind::InvalidRequestException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is ListDimensionsErrorKind::ThrottlingException
.
Trait Implementations§
source§impl Debug for ListDimensionsError
impl Debug for ListDimensionsError
source§impl Display for ListDimensionsError
impl Display for ListDimensionsError
source§impl Error for ListDimensionsError
impl Error for ListDimensionsError
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<ListDimensionsError> for Error
impl From<ListDimensionsError> for Error
source§fn from(err: ListDimensionsError) -> Self
fn from(err: ListDimensionsError) -> Self
Converts to this type from the input type.