#[non_exhaustive]pub struct ListTestGridProjectsError {
pub kind: ListTestGridProjectsErrorKind,
/* private fields */
}Expand description
Error type for the ListTestGridProjects 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: ListTestGridProjectsErrorKindKind of error that occurred.
Implementations§
source§impl ListTestGridProjectsError
impl ListTestGridProjectsError
sourcepub fn new(kind: ListTestGridProjectsErrorKind, meta: Error) -> Self
pub fn new(kind: ListTestGridProjectsErrorKind, meta: Error) -> Self
Creates a new ListTestGridProjectsError.
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 ListTestGridProjectsError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 5649)
5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692
pub fn parse_list_test_grid_projects_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListTestGridProjectsOutput,
crate::error::ListTestGridProjectsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListTestGridProjectsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListTestGridProjectsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ArgumentException" => {
crate::error::ListTestGridProjectsError {
meta: generic,
kind: crate::error::ListTestGridProjectsErrorKind::ArgumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::argument_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_argument_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTestGridProjectsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InternalServiceException" => crate::error::ListTestGridProjectsError {
meta: generic,
kind: crate::error::ListTestGridProjectsErrorKind::InternalServiceException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_service_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_service_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTestGridProjectsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListTestGridProjectsError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListTestGridProjectsError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 5690)
5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692
pub fn parse_list_test_grid_projects_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListTestGridProjectsOutput,
crate::error::ListTestGridProjectsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListTestGridProjectsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListTestGridProjectsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ArgumentException" => {
crate::error::ListTestGridProjectsError {
meta: generic,
kind: crate::error::ListTestGridProjectsErrorKind::ArgumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::argument_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_argument_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTestGridProjectsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InternalServiceException" => crate::error::ListTestGridProjectsError {
meta: generic,
kind: crate::error::ListTestGridProjectsErrorKind::InternalServiceException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_service_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_service_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListTestGridProjectsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListTestGridProjectsError::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_argument_exception(&self) -> bool
pub fn is_argument_exception(&self) -> bool
Returns true if the error kind is ListTestGridProjectsErrorKind::ArgumentException.
sourcepub fn is_internal_service_exception(&self) -> bool
pub fn is_internal_service_exception(&self) -> bool
Returns true if the error kind is ListTestGridProjectsErrorKind::InternalServiceException.
Trait Implementations§
source§impl Debug for ListTestGridProjectsError
impl Debug for ListTestGridProjectsError
source§impl Display for ListTestGridProjectsError
impl Display for ListTestGridProjectsError
source§impl Error for ListTestGridProjectsError
impl Error for ListTestGridProjectsError
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<ListTestGridProjectsError> for Error
impl From<ListTestGridProjectsError> for Error
source§fn from(err: ListTestGridProjectsError) -> Self
fn from(err: ListTestGridProjectsError) -> Self
Converts to this type from the input type.