Struct aws_sdk_iot::error::GetV2LoggingOptionsError
source · #[non_exhaustive]pub struct GetV2LoggingOptionsError {
pub kind: GetV2LoggingOptionsErrorKind,
/* private fields */
}
Expand description
Error type for the GetV2LoggingOptions
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: GetV2LoggingOptionsErrorKind
Kind of error that occurred.
Implementations§
source§impl GetV2LoggingOptionsError
impl GetV2LoggingOptionsError
sourcepub fn new(kind: GetV2LoggingOptionsErrorKind, meta: Error) -> Self
pub fn new(kind: GetV2LoggingOptionsErrorKind, meta: Error) -> Self
Creates a new GetV2LoggingOptionsError
.
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 GetV2LoggingOptionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 16878)
16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939
pub fn parse_get_v2_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetV2LoggingOptionsOutput,
crate::error::GetV2LoggingOptionsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetV2LoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::GetV2LoggingOptionsError {
meta: generic,
kind: crate::error::GetV2LoggingOptionsErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"NotConfiguredException" => crate::error::GetV2LoggingOptionsError {
meta: generic,
kind: crate::error::GetV2LoggingOptionsErrorKind::NotConfiguredException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_configured_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_configured_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::GetV2LoggingOptionsError {
meta: generic,
kind: crate::error::GetV2LoggingOptionsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetV2LoggingOptionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetV2LoggingOptionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 16937)
16868 16869 16870 16871 16872 16873 16874 16875 16876 16877 16878 16879 16880 16881 16882 16883 16884 16885 16886 16887 16888 16889 16890 16891 16892 16893 16894 16895 16896 16897 16898 16899 16900 16901 16902 16903 16904 16905 16906 16907 16908 16909 16910 16911 16912 16913 16914 16915 16916 16917 16918 16919 16920 16921 16922 16923 16924 16925 16926 16927 16928 16929 16930 16931 16932 16933 16934 16935 16936 16937 16938 16939
pub fn parse_get_v2_logging_options_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetV2LoggingOptionsOutput,
crate::error::GetV2LoggingOptionsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetV2LoggingOptionsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::GetV2LoggingOptionsError {
meta: generic,
kind: crate::error::GetV2LoggingOptionsErrorKind::InternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"NotConfiguredException" => crate::error::GetV2LoggingOptionsError {
meta: generic,
kind: crate::error::GetV2LoggingOptionsErrorKind::NotConfiguredException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_configured_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_configured_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::GetV2LoggingOptionsError {
meta: generic,
kind: crate::error::GetV2LoggingOptionsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetV2LoggingOptionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetV2LoggingOptionsError::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_internal_exception(&self) -> bool
pub fn is_internal_exception(&self) -> bool
Returns true
if the error kind is GetV2LoggingOptionsErrorKind::InternalException
.
sourcepub fn is_not_configured_exception(&self) -> bool
pub fn is_not_configured_exception(&self) -> bool
Returns true
if the error kind is GetV2LoggingOptionsErrorKind::NotConfiguredException
.
Returns true
if the error kind is GetV2LoggingOptionsErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for GetV2LoggingOptionsError
impl Debug for GetV2LoggingOptionsError
source§impl Display for GetV2LoggingOptionsError
impl Display for GetV2LoggingOptionsError
source§impl Error for GetV2LoggingOptionsError
impl Error for GetV2LoggingOptionsError
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<GetV2LoggingOptionsError> for Error
impl From<GetV2LoggingOptionsError> for Error
source§fn from(err: GetV2LoggingOptionsError) -> Self
fn from(err: GetV2LoggingOptionsError) -> Self
Converts to this type from the input type.