#[non_exhaustive]pub struct CreateFirewallError {
pub kind: CreateFirewallErrorKind,
/* private fields */
}
Expand description
Error type for the CreateFirewall
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: CreateFirewallErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateFirewallError
impl CreateFirewallError
sourcepub fn new(kind: CreateFirewallErrorKind, meta: Error) -> Self
pub fn new(kind: CreateFirewallErrorKind, meta: Error) -> Self
Creates a new CreateFirewallError
.
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 CreateFirewallError::Unhandled
variant from any error type.
Examples found in repository?
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
pub fn parse_create_firewall_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateFirewallOutput, crate::error::CreateFirewallError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateFirewallError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateFirewallError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InsufficientCapacityException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::InsufficientCapacityException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::insufficient_capacity_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_insufficient_capacity_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::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::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidOperationException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::InvalidOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::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::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"LimitExceededException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::LimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::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::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateFirewallError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateFirewallError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
pub fn parse_create_firewall_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::CreateFirewallOutput, crate::error::CreateFirewallError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateFirewallError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::CreateFirewallError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InsufficientCapacityException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::InsufficientCapacityException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::insufficient_capacity_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_insufficient_capacity_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::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::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidOperationException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::InvalidOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::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::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"LimitExceededException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::LimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::CreateFirewallError {
meta: generic,
kind: crate::error::CreateFirewallErrorKind::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::CreateFirewallError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateFirewallError::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_insufficient_capacity_exception(&self) -> bool
pub fn is_insufficient_capacity_exception(&self) -> bool
Returns true
if the error kind is CreateFirewallErrorKind::InsufficientCapacityException
.
sourcepub fn is_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is CreateFirewallErrorKind::InternalServerError
.
sourcepub fn is_invalid_operation_exception(&self) -> bool
pub fn is_invalid_operation_exception(&self) -> bool
Returns true
if the error kind is CreateFirewallErrorKind::InvalidOperationException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is CreateFirewallErrorKind::InvalidRequestException
.
sourcepub fn is_limit_exceeded_exception(&self) -> bool
pub fn is_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is CreateFirewallErrorKind::LimitExceededException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is CreateFirewallErrorKind::ThrottlingException
.