#[non_exhaustive]pub struct GetDeployablePatchSnapshotForInstanceError {
pub kind: GetDeployablePatchSnapshotForInstanceErrorKind,
/* private fields */
}
Expand description
Error type for the GetDeployablePatchSnapshotForInstance
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: GetDeployablePatchSnapshotForInstanceErrorKind
Kind of error that occurred.
Implementations§
source§impl GetDeployablePatchSnapshotForInstanceError
impl GetDeployablePatchSnapshotForInstanceError
sourcepub fn new(
kind: GetDeployablePatchSnapshotForInstanceErrorKind,
meta: Error
) -> Self
pub fn new(
kind: GetDeployablePatchSnapshotForInstanceErrorKind,
meta: Error
) -> Self
Creates a new GetDeployablePatchSnapshotForInstanceError
.
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 GetDeployablePatchSnapshotForInstanceError::Unhandled
variant from any error type.
Examples found in repository?
6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256
pub fn parse_get_deployable_patch_snapshot_for_instance_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetDeployablePatchSnapshotForInstanceOutput,
crate::error::GetDeployablePatchSnapshotForInstanceError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::GetDeployablePatchSnapshotForInstanceError { meta: generic, kind: crate::error::GetDeployablePatchSnapshotForInstanceErrorKind::InternalServerError({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnsupportedFeatureRequiredException" => crate::error::GetDeployablePatchSnapshotForInstanceError { meta: generic, kind: crate::error::GetDeployablePatchSnapshotForInstanceErrorKind::UnsupportedFeatureRequiredException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unsupported_feature_required_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_feature_required_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnsupportedOperatingSystem" => crate::error::GetDeployablePatchSnapshotForInstanceError { meta: generic, kind: crate::error::GetDeployablePatchSnapshotForInstanceErrorKind::UnsupportedOperatingSystem({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unsupported_operating_system::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_operating_system_json_err(response.body().as_ref(), output).map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetDeployablePatchSnapshotForInstanceError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetDeployablePatchSnapshotForInstanceError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256
pub fn parse_get_deployable_patch_snapshot_for_instance_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetDeployablePatchSnapshotForInstanceOutput,
crate::error::GetDeployablePatchSnapshotForInstanceError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(
crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled(generic),
)
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::GetDeployablePatchSnapshotForInstanceError { meta: generic, kind: crate::error::GetDeployablePatchSnapshotForInstanceErrorKind::InternalServerError({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnsupportedFeatureRequiredException" => crate::error::GetDeployablePatchSnapshotForInstanceError { meta: generic, kind: crate::error::GetDeployablePatchSnapshotForInstanceErrorKind::UnsupportedFeatureRequiredException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unsupported_feature_required_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_feature_required_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"UnsupportedOperatingSystem" => crate::error::GetDeployablePatchSnapshotForInstanceError { meta: generic, kind: crate::error::GetDeployablePatchSnapshotForInstanceErrorKind::UnsupportedOperatingSystem({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::unsupported_operating_system::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_operating_system_json_err(response.body().as_ref(), output).map_err(crate::error::GetDeployablePatchSnapshotForInstanceError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetDeployablePatchSnapshotForInstanceError::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_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is GetDeployablePatchSnapshotForInstanceErrorKind::InternalServerError
.
sourcepub fn is_unsupported_feature_required_exception(&self) -> bool
pub fn is_unsupported_feature_required_exception(&self) -> bool
Returns true
if the error kind is GetDeployablePatchSnapshotForInstanceErrorKind::UnsupportedFeatureRequiredException
.
sourcepub fn is_unsupported_operating_system(&self) -> bool
pub fn is_unsupported_operating_system(&self) -> bool
Returns true
if the error kind is GetDeployablePatchSnapshotForInstanceErrorKind::UnsupportedOperatingSystem
.