Struct aws_sdk_memorydb::error::UpdateSubnetGroupError
source · #[non_exhaustive]pub struct UpdateSubnetGroupError {
pub kind: UpdateSubnetGroupErrorKind,
/* private fields */
}
Expand description
Error type for the UpdateSubnetGroup
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: UpdateSubnetGroupErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdateSubnetGroupError
impl UpdateSubnetGroupError
sourcepub fn new(kind: UpdateSubnetGroupErrorKind, meta: Error) -> Self
pub fn new(kind: UpdateSubnetGroupErrorKind, meta: Error) -> Self
Creates a new UpdateSubnetGroupError
.
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 UpdateSubnetGroupError::Unhandled
variant from any error type.
Examples found in repository?
4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705
pub fn parse_update_subnet_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateSubnetGroupOutput, crate::error::UpdateSubnetGroupError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateSubnetGroupError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidSubnet" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::InvalidSubnet({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_subnet::Builder::default();
let _ = response;
output =
crate::json_deser::deser_structure_crate_error_invalid_subnet_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceLinkedRoleNotFoundFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::ServiceLinkedRoleNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_linked_role_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_linked_role_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetGroupNotFoundFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetGroupNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_group_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_group_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetInUse" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetInUse({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_in_use::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_in_use_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetNotAllowedFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetNotAllowedFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_not_allowed_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_not_allowed_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetQuotaExceededFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_quota_exceeded_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateSubnetGroupError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateSubnetGroupError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705
pub fn parse_update_subnet_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateSubnetGroupOutput, crate::error::UpdateSubnetGroupError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateSubnetGroupError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidSubnet" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::InvalidSubnet({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_subnet::Builder::default();
let _ = response;
output =
crate::json_deser::deser_structure_crate_error_invalid_subnet_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceLinkedRoleNotFoundFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::ServiceLinkedRoleNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_linked_role_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_linked_role_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetGroupNotFoundFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetGroupNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_group_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_group_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetInUse" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetInUse({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_in_use::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_in_use_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetNotAllowedFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetNotAllowedFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_not_allowed_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_not_allowed_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetQuotaExceededFault" => crate::error::UpdateSubnetGroupError {
meta: generic,
kind: crate::error::UpdateSubnetGroupErrorKind::SubnetQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_subnet_quota_exceeded_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateSubnetGroupError::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_subnet(&self) -> bool
pub fn is_invalid_subnet(&self) -> bool
Returns true
if the error kind is UpdateSubnetGroupErrorKind::InvalidSubnet
.
sourcepub fn is_service_linked_role_not_found_fault(&self) -> bool
pub fn is_service_linked_role_not_found_fault(&self) -> bool
Returns true
if the error kind is UpdateSubnetGroupErrorKind::ServiceLinkedRoleNotFoundFault
.
sourcepub fn is_subnet_group_not_found_fault(&self) -> bool
pub fn is_subnet_group_not_found_fault(&self) -> bool
Returns true
if the error kind is UpdateSubnetGroupErrorKind::SubnetGroupNotFoundFault
.
sourcepub fn is_subnet_in_use(&self) -> bool
pub fn is_subnet_in_use(&self) -> bool
Returns true
if the error kind is UpdateSubnetGroupErrorKind::SubnetInUse
.
sourcepub fn is_subnet_not_allowed_fault(&self) -> bool
pub fn is_subnet_not_allowed_fault(&self) -> bool
Returns true
if the error kind is UpdateSubnetGroupErrorKind::SubnetNotAllowedFault
.
sourcepub fn is_subnet_quota_exceeded_fault(&self) -> bool
pub fn is_subnet_quota_exceeded_fault(&self) -> bool
Returns true
if the error kind is UpdateSubnetGroupErrorKind::SubnetQuotaExceededFault
.