#[non_exhaustive]pub struct UpdateFirewallPolicyChangeProtectionError {
pub kind: UpdateFirewallPolicyChangeProtectionErrorKind,
/* private fields */
}
Expand description
Error type for the UpdateFirewallPolicyChangeProtection
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: UpdateFirewallPolicyChangeProtectionErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdateFirewallPolicyChangeProtectionError
impl UpdateFirewallPolicyChangeProtectionError
sourcepub fn new(
kind: UpdateFirewallPolicyChangeProtectionErrorKind,
meta: Error
) -> Self
pub fn new(
kind: UpdateFirewallPolicyChangeProtectionErrorKind,
meta: Error
) -> Self
Creates a new UpdateFirewallPolicyChangeProtectionError
.
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 UpdateFirewallPolicyChangeProtectionError::Unhandled
variant from any error type.
Examples found in repository?
3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337
pub fn parse_update_firewall_policy_change_protection_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdateFirewallPolicyChangeProtectionOutput,
crate::error::UpdateFirewallPolicyChangeProtectionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::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::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::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::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidTokenException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::InvalidTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceOwnerCheckException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::ResourceOwnerCheckException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_owner_check_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_owner_check_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ThrottlingException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::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::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::UpdateFirewallPolicyChangeProtectionError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateFirewallPolicyChangeProtectionError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337
pub fn parse_update_firewall_policy_change_protection_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::UpdateFirewallPolicyChangeProtectionOutput,
crate::error::UpdateFirewallPolicyChangeProtectionError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::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::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::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::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidTokenException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::InvalidTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceOwnerCheckException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::ResourceOwnerCheckException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_owner_check_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_owner_check_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ThrottlingException" => crate::error::UpdateFirewallPolicyChangeProtectionError { meta: generic, kind: crate::error::UpdateFirewallPolicyChangeProtectionErrorKind::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::UpdateFirewallPolicyChangeProtectionError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::UpdateFirewallPolicyChangeProtectionError::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 UpdateFirewallPolicyChangeProtectionErrorKind::InternalServerError
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is UpdateFirewallPolicyChangeProtectionErrorKind::InvalidRequestException
.
sourcepub fn is_invalid_token_exception(&self) -> bool
pub fn is_invalid_token_exception(&self) -> bool
Returns true
if the error kind is UpdateFirewallPolicyChangeProtectionErrorKind::InvalidTokenException
.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true
if the error kind is UpdateFirewallPolicyChangeProtectionErrorKind::ResourceNotFoundException
.
sourcepub fn is_resource_owner_check_exception(&self) -> bool
pub fn is_resource_owner_check_exception(&self) -> bool
Returns true
if the error kind is UpdateFirewallPolicyChangeProtectionErrorKind::ResourceOwnerCheckException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is UpdateFirewallPolicyChangeProtectionErrorKind::ThrottlingException
.