Struct aws_sdk_cloudfront::error::GetKeyGroupConfigError
source · #[non_exhaustive]pub struct GetKeyGroupConfigError {
pub kind: GetKeyGroupConfigErrorKind,
/* private fields */
}
Expand description
Error type for the GetKeyGroupConfig
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: GetKeyGroupConfigErrorKind
Kind of error that occurred.
Implementations§
source§impl GetKeyGroupConfigError
impl GetKeyGroupConfigError
sourcepub fn new(kind: GetKeyGroupConfigErrorKind, meta: Error) -> Self
pub fn new(kind: GetKeyGroupConfigErrorKind, meta: Error) -> Self
Creates a new GetKeyGroupConfigError
.
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 GetKeyGroupConfigError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 7180)
7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235
pub fn parse_get_key_group_config_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetKeyGroupConfigOutput, crate::error::GetKeyGroupConfigError>
{
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::GetKeyGroupConfigError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetKeyGroupConfigError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchResource" => crate::error::GetKeyGroupConfigError {
meta: generic,
kind: crate::error::GetKeyGroupConfigErrorKind::NoSuchResource({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_resource::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_no_such_resource_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetKeyGroupConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetKeyGroupConfigError::generic(generic),
})
}
#[allow(clippy::unnecessary_wraps)]
pub fn parse_get_key_group_config_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetKeyGroupConfigOutput, crate::error::GetKeyGroupConfigError>
{
Ok({
#[allow(unused_mut)]
let mut output = crate::output::get_key_group_config_output::Builder::default();
let _ = response;
output = output.set_e_tag(
crate::http_serde::deser_header_get_key_group_config_get_key_group_config_output_e_tag(
response.headers(),
)
.map_err(|_| {
crate::error::GetKeyGroupConfigError::unhandled(
"Failed to parse ETag from header `ETag",
)
})?,
);
output = output.set_key_group_config(
crate::http_serde::deser_payload_get_key_group_config_get_key_group_config_output_key_group_config(response.body().as_ref())?
);
output.build()
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetKeyGroupConfigError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 7207)
7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209
pub fn parse_get_key_group_config_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetKeyGroupConfigOutput, crate::error::GetKeyGroupConfigError>
{
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::GetKeyGroupConfigError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetKeyGroupConfigError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"NoSuchResource" => crate::error::GetKeyGroupConfigError {
meta: generic,
kind: crate::error::GetKeyGroupConfigErrorKind::NoSuchResource({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::no_such_resource::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_no_such_resource_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetKeyGroupConfigError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetKeyGroupConfigError::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_no_such_resource(&self) -> bool
pub fn is_no_such_resource(&self) -> bool
Returns true
if the error kind is GetKeyGroupConfigErrorKind::NoSuchResource
.
Trait Implementations§
source§impl Debug for GetKeyGroupConfigError
impl Debug for GetKeyGroupConfigError
source§impl Display for GetKeyGroupConfigError
impl Display for GetKeyGroupConfigError
source§impl Error for GetKeyGroupConfigError
impl Error for GetKeyGroupConfigError
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<GetKeyGroupConfigError> for Error
impl From<GetKeyGroupConfigError> for Error
source§fn from(err: GetKeyGroupConfigError) -> Self
fn from(err: GetKeyGroupConfigError) -> Self
Converts to this type from the input type.