#[non_exhaustive]pub struct ListStreamingDistributionsError {
pub kind: ListStreamingDistributionsErrorKind,
/* private fields */
}
Expand description
Error type for the ListStreamingDistributions
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: ListStreamingDistributionsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListStreamingDistributionsError
impl ListStreamingDistributionsError
sourcepub fn new(kind: ListStreamingDistributionsErrorKind, meta: Error) -> Self
pub fn new(kind: ListStreamingDistributionsErrorKind, meta: Error) -> Self
Creates a new ListStreamingDistributionsError
.
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 ListStreamingDistributionsError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (lines 9887-9889)
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
pub fn parse_list_streaming_distributions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListStreamingDistributionsOutput,
crate::error::ListStreamingDistributionsError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ListStreamingDistributionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListStreamingDistributionsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidArgument" => crate::error::ListStreamingDistributionsError {
meta: generic,
kind: crate::error::ListStreamingDistributionsErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::ListStreamingDistributionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListStreamingDistributionsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListStreamingDistributionsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 9917)
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
pub fn parse_list_streaming_distributions_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListStreamingDistributionsOutput,
crate::error::ListStreamingDistributionsError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::ListStreamingDistributionsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListStreamingDistributionsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidArgument" => crate::error::ListStreamingDistributionsError {
meta: generic,
kind: crate::error::ListStreamingDistributionsErrorKind::InvalidArgument({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_argument::Builder::default();
let _ = response;
output =
crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::ListStreamingDistributionsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListStreamingDistributionsError::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_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true
if the error kind is ListStreamingDistributionsErrorKind::InvalidArgument
.
Trait Implementations§
source§impl Error for ListStreamingDistributionsError
impl Error for ListStreamingDistributionsError
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<ListStreamingDistributionsError> for Error
impl From<ListStreamingDistributionsError> for Error
source§fn from(err: ListStreamingDistributionsError) -> Self
fn from(err: ListStreamingDistributionsError) -> Self
Converts to this type from the input type.