Struct aws_sdk_iot::error::DeleteV2LoggingLevelError
source · #[non_exhaustive]pub struct DeleteV2LoggingLevelError {
pub kind: DeleteV2LoggingLevelErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteV2LoggingLevel
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: DeleteV2LoggingLevelErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteV2LoggingLevelError
impl DeleteV2LoggingLevelError
sourcepub fn new(kind: DeleteV2LoggingLevelErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteV2LoggingLevelErrorKind, meta: Error) -> Self
Creates a new DeleteV2LoggingLevelError
.
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 DeleteV2LoggingLevelError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 9859)
9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920
pub fn parse_delete_v2_logging_level_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteV2LoggingLevelOutput,
crate::error::DeleteV2LoggingLevelError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteV2LoggingLevelError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteV2LoggingLevelError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::DeleteV2LoggingLevelError {
meta: generic,
kind: crate::error::DeleteV2LoggingLevelErrorKind::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::DeleteV2LoggingLevelError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::DeleteV2LoggingLevelError {
meta: generic,
kind: crate::error::DeleteV2LoggingLevelErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteV2LoggingLevelError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteV2LoggingLevelError {
meta: generic,
kind: crate::error::DeleteV2LoggingLevelErrorKind::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::DeleteV2LoggingLevelError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteV2LoggingLevelError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteV2LoggingLevelError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 9918)
9849 9850 9851 9852 9853 9854 9855 9856 9857 9858 9859 9860 9861 9862 9863 9864 9865 9866 9867 9868 9869 9870 9871 9872 9873 9874 9875 9876 9877 9878 9879 9880 9881 9882 9883 9884 9885 9886 9887 9888 9889 9890 9891 9892 9893 9894 9895 9896 9897 9898 9899 9900 9901 9902 9903 9904 9905 9906 9907 9908 9909 9910 9911 9912 9913 9914 9915 9916 9917 9918 9919 9920
pub fn parse_delete_v2_logging_level_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteV2LoggingLevelOutput,
crate::error::DeleteV2LoggingLevelError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteV2LoggingLevelError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteV2LoggingLevelError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalException" => {
crate::error::DeleteV2LoggingLevelError {
meta: generic,
kind: crate::error::DeleteV2LoggingLevelErrorKind::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::DeleteV2LoggingLevelError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidRequestException" => crate::error::DeleteV2LoggingLevelError {
meta: generic,
kind: crate::error::DeleteV2LoggingLevelErrorKind::InvalidRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteV2LoggingLevelError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteV2LoggingLevelError {
meta: generic,
kind: crate::error::DeleteV2LoggingLevelErrorKind::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::DeleteV2LoggingLevelError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DeleteV2LoggingLevelError::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 DeleteV2LoggingLevelErrorKind::InternalException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is DeleteV2LoggingLevelErrorKind::InvalidRequestException
.
Returns true
if the error kind is DeleteV2LoggingLevelErrorKind::ServiceUnavailableException
.
Trait Implementations§
source§impl Debug for DeleteV2LoggingLevelError
impl Debug for DeleteV2LoggingLevelError
source§impl Display for DeleteV2LoggingLevelError
impl Display for DeleteV2LoggingLevelError
source§impl Error for DeleteV2LoggingLevelError
impl Error for DeleteV2LoggingLevelError
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<DeleteV2LoggingLevelError> for Error
impl From<DeleteV2LoggingLevelError> for Error
source§fn from(err: DeleteV2LoggingLevelError) -> Self
fn from(err: DeleteV2LoggingLevelError) -> Self
Converts to this type from the input type.