#[non_exhaustive]pub struct DescribeOrganizationConformancePacksError {
pub kind: DescribeOrganizationConformancePacksErrorKind,
/* private fields */
}Expand description
Error type for the DescribeOrganizationConformancePacks 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: DescribeOrganizationConformancePacksErrorKindKind of error that occurred.
Implementations§
source§impl DescribeOrganizationConformancePacksError
impl DescribeOrganizationConformancePacksError
sourcepub fn new(
kind: DescribeOrganizationConformancePacksErrorKind,
meta: Error
) -> Self
pub fn new(
kind: DescribeOrganizationConformancePacksErrorKind,
meta: Error
) -> Self
Creates a new DescribeOrganizationConformancePacksError.
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 DescribeOrganizationConformancePacksError::Unhandled variant from any error type.
Examples found in repository?
2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855
pub fn parse_describe_organization_conformance_packs_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DescribeOrganizationConformancePacksOutput,
crate::error::DescribeOrganizationConformancePacksError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DescribeOrganizationConformancePacksError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidLimitException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::InvalidLimitException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidNextTokenException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::InvalidNextTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoSuchOrganizationConformancePackException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::NoSuchOrganizationConformancePackException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_organization_conformance_pack_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_such_organization_conformance_pack_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DescribeOrganizationConformancePacksError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DescribeOrganizationConformancePacksError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855
pub fn parse_describe_organization_conformance_packs_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DescribeOrganizationConformancePacksOutput,
crate::error::DescribeOrganizationConformancePacksError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::DescribeOrganizationConformancePacksError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidLimitException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::InvalidLimitException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_limit_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_limit_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidNextTokenException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::InvalidNextTokenException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_next_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoSuchOrganizationConformancePackException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::NoSuchOrganizationConformancePackException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_such_organization_conformance_pack_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_such_organization_conformance_pack_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::DescribeOrganizationConformancePacksError { meta: generic, kind: crate::error::DescribeOrganizationConformancePacksErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DescribeOrganizationConformancePacksError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::DescribeOrganizationConformancePacksError::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_limit_exception(&self) -> bool
pub fn is_invalid_limit_exception(&self) -> bool
Returns true if the error kind is DescribeOrganizationConformancePacksErrorKind::InvalidLimitException.
sourcepub fn is_invalid_next_token_exception(&self) -> bool
pub fn is_invalid_next_token_exception(&self) -> bool
Returns true if the error kind is DescribeOrganizationConformancePacksErrorKind::InvalidNextTokenException.
sourcepub fn is_no_such_organization_conformance_pack_exception(&self) -> bool
pub fn is_no_such_organization_conformance_pack_exception(&self) -> bool
Returns true if the error kind is DescribeOrganizationConformancePacksErrorKind::NoSuchOrganizationConformancePackException.
sourcepub fn is_organization_access_denied_exception(&self) -> bool
pub fn is_organization_access_denied_exception(&self) -> bool
Returns true if the error kind is DescribeOrganizationConformancePacksErrorKind::OrganizationAccessDeniedException.