Struct aws_sdk_devicefarm::error::ListOfferingsError
source · #[non_exhaustive]pub struct ListOfferingsError {
pub kind: ListOfferingsErrorKind,
/* private fields */
}Expand description
Error type for the ListOfferings 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: ListOfferingsErrorKindKind of error that occurred.
Implementations§
source§impl ListOfferingsError
impl ListOfferingsError
sourcepub fn new(kind: ListOfferingsErrorKind, meta: Error) -> Self
pub fn new(kind: ListOfferingsErrorKind, meta: Error) -> Self
Creates a new ListOfferingsError.
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 ListOfferingsError::Unhandled variant from any error type.
Examples found in repository?
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 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865
pub fn parse_list_offerings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListOfferingsOutput, crate::error::ListOfferingsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListOfferingsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListOfferingsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ArgumentException" => {
crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::ArgumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::argument_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_argument_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"LimitExceededException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::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::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotEligibleException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::NotEligibleException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_eligible_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_eligible_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceAccountException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::ServiceAccountException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_account_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_account_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListOfferingsError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListOfferingsError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
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 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865
pub fn parse_list_offerings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListOfferingsOutput, crate::error::ListOfferingsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListOfferingsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListOfferingsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ArgumentException" => {
crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::ArgumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::argument_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_argument_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"LimitExceededException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::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::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotEligibleException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::NotEligibleException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_eligible_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_eligible_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceAccountException" => crate::error::ListOfferingsError {
meta: generic,
kind: crate::error::ListOfferingsErrorKind::ServiceAccountException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::service_account_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_account_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListOfferingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListOfferingsError::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_argument_exception(&self) -> bool
pub fn is_argument_exception(&self) -> bool
Returns true if the error kind is ListOfferingsErrorKind::ArgumentException.
sourcepub fn is_limit_exceeded_exception(&self) -> bool
pub fn is_limit_exceeded_exception(&self) -> bool
Returns true if the error kind is ListOfferingsErrorKind::LimitExceededException.
sourcepub fn is_not_eligible_exception(&self) -> bool
pub fn is_not_eligible_exception(&self) -> bool
Returns true if the error kind is ListOfferingsErrorKind::NotEligibleException.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true if the error kind is ListOfferingsErrorKind::NotFoundException.
sourcepub fn is_service_account_exception(&self) -> bool
pub fn is_service_account_exception(&self) -> bool
Returns true if the error kind is ListOfferingsErrorKind::ServiceAccountException.