Struct aws_sdk_memorydb::error::UpdateUserError
source · #[non_exhaustive]pub struct UpdateUserError {
pub kind: UpdateUserErrorKind,
/* private fields */
}
Expand description
Error type for the UpdateUser
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: UpdateUserErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdateUserError
impl UpdateUserError
sourcepub fn new(kind: UpdateUserErrorKind, meta: Error) -> Self
pub fn new(kind: UpdateUserErrorKind, meta: Error) -> Self
Creates a new UpdateUserError
.
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 UpdateUserError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 4733)
4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810
pub fn parse_update_user_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateUserOutput, crate::error::UpdateUserError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateUserError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateUserError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterCombinationException" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::InvalidParameterCombinationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_combination_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_combination_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidUserStateFault" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::InvalidUserStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_user_state_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_user_state_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UserNotFoundFault" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::UserNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::user_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_user_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateUserError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateUserError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 4808)
4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810
pub fn parse_update_user_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateUserOutput, crate::error::UpdateUserError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateUserError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateUserError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidParameterCombinationException" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::InvalidParameterCombinationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_combination_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_combination_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidUserStateFault" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::InvalidUserStateFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_user_state_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_user_state_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UserNotFoundFault" => crate::error::UpdateUserError {
meta: generic,
kind: crate::error::UpdateUserErrorKind::UserNotFoundFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::user_not_found_fault::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_user_not_found_fault_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateUserError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateUserError::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_parameter_combination_exception(&self) -> bool
pub fn is_invalid_parameter_combination_exception(&self) -> bool
Returns true
if the error kind is UpdateUserErrorKind::InvalidParameterCombinationException
.
sourcepub fn is_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true
if the error kind is UpdateUserErrorKind::InvalidParameterValueException
.
sourcepub fn is_invalid_user_state_fault(&self) -> bool
pub fn is_invalid_user_state_fault(&self) -> bool
Returns true
if the error kind is UpdateUserErrorKind::InvalidUserStateFault
.
sourcepub fn is_user_not_found_fault(&self) -> bool
pub fn is_user_not_found_fault(&self) -> bool
Returns true
if the error kind is UpdateUserErrorKind::UserNotFoundFault
.
Trait Implementations§
source§impl Debug for UpdateUserError
impl Debug for UpdateUserError
source§impl Display for UpdateUserError
impl Display for UpdateUserError
source§impl Error for UpdateUserError
impl Error for UpdateUserError
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<UpdateUserError> for Error
impl From<UpdateUserError> for Error
source§fn from(err: UpdateUserError) -> Self
fn from(err: UpdateUserError) -> Self
Converts to this type from the input type.