Struct aws_sdk_config::error::SelectResourceConfigError
source · #[non_exhaustive]pub struct SelectResourceConfigError {
pub kind: SelectResourceConfigErrorKind,
/* private fields */
}Expand description
Error type for the SelectResourceConfig 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: SelectResourceConfigErrorKindKind of error that occurred.
Implementations§
source§impl SelectResourceConfigError
impl SelectResourceConfigError
sourcepub fn new(kind: SelectResourceConfigErrorKind, meta: Error) -> Self
pub fn new(kind: SelectResourceConfigErrorKind, meta: Error) -> Self
Creates a new SelectResourceConfigError.
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 SelectResourceConfigError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 6961)
6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019
pub fn parse_select_resource_config_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::SelectResourceConfigOutput,
crate::error::SelectResourceConfigError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::SelectResourceConfigError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SelectResourceConfigError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidExpressionException" => crate::error::SelectResourceConfigError {
meta: generic,
kind: crate::error::SelectResourceConfigErrorKind::InvalidExpressionException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_expression_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_expression_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SelectResourceConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidLimitException" => crate::error::SelectResourceConfigError {
meta: generic,
kind: crate::error::SelectResourceConfigErrorKind::InvalidLimitException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SelectResourceConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidNextTokenException" => crate::error::SelectResourceConfigError {
meta: generic,
kind: crate::error::SelectResourceConfigErrorKind::InvalidNextTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SelectResourceConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SelectResourceConfigError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the SelectResourceConfigError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 7017)
6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019
pub fn parse_select_resource_config_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::SelectResourceConfigOutput,
crate::error::SelectResourceConfigError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::SelectResourceConfigError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::SelectResourceConfigError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidExpressionException" => crate::error::SelectResourceConfigError {
meta: generic,
kind: crate::error::SelectResourceConfigErrorKind::InvalidExpressionException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_expression_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_expression_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SelectResourceConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidLimitException" => crate::error::SelectResourceConfigError {
meta: generic,
kind: crate::error::SelectResourceConfigErrorKind::InvalidLimitException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SelectResourceConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidNextTokenException" => crate::error::SelectResourceConfigError {
meta: generic,
kind: crate::error::SelectResourceConfigErrorKind::InvalidNextTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::SelectResourceConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::SelectResourceConfigError::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_invalid_expression_exception(&self) -> bool
pub fn is_invalid_expression_exception(&self) -> bool
Returns true if the error kind is SelectResourceConfigErrorKind::InvalidExpressionException.
sourcepub fn is_invalid_limit_exception(&self) -> bool
pub fn is_invalid_limit_exception(&self) -> bool
Returns true if the error kind is SelectResourceConfigErrorKind::InvalidLimitException.
sourcepub fn is_invalid_next_token_exception(&self) -> bool
pub fn is_invalid_next_token_exception(&self) -> bool
Returns true if the error kind is SelectResourceConfigErrorKind::InvalidNextTokenException.
Trait Implementations§
source§impl Debug for SelectResourceConfigError
impl Debug for SelectResourceConfigError
source§impl Display for SelectResourceConfigError
impl Display for SelectResourceConfigError
source§impl Error for SelectResourceConfigError
impl Error for SelectResourceConfigError
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<SelectResourceConfigError> for Error
impl From<SelectResourceConfigError> for Error
source§fn from(err: SelectResourceConfigError) -> Self
fn from(err: SelectResourceConfigError) -> Self
Converts to this type from the input type.