Struct aws_sdk_ssm::error::StartAssociationsOnceError
source · #[non_exhaustive]pub struct StartAssociationsOnceError {
pub kind: StartAssociationsOnceErrorKind,
/* private fields */
}
Expand description
Error type for the StartAssociationsOnce
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: StartAssociationsOnceErrorKind
Kind of error that occurred.
Implementations§
source§impl StartAssociationsOnceError
impl StartAssociationsOnceError
sourcepub fn new(kind: StartAssociationsOnceErrorKind, meta: Error) -> Self
pub fn new(kind: StartAssociationsOnceErrorKind, meta: Error) -> Self
Creates a new StartAssociationsOnceError
.
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 StartAssociationsOnceError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 11568)
11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609
pub fn parse_start_associations_once_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartAssociationsOnceOutput,
crate::error::StartAssociationsOnceError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StartAssociationsOnceError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StartAssociationsOnceError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AssociationDoesNotExist" => crate::error::StartAssociationsOnceError {
meta: generic,
kind: crate::error::StartAssociationsOnceErrorKind::AssociationDoesNotExist({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::association_does_not_exist::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_association_does_not_exist_json_err(response.body().as_ref(), output).map_err(crate::error::StartAssociationsOnceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidAssociation" => crate::error::StartAssociationsOnceError {
meta: generic,
kind: crate::error::StartAssociationsOnceErrorKind::InvalidAssociation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_association::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_association_json_err(response.body().as_ref(), output).map_err(crate::error::StartAssociationsOnceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StartAssociationsOnceError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StartAssociationsOnceError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 11607)
11558 11559 11560 11561 11562 11563 11564 11565 11566 11567 11568 11569 11570 11571 11572 11573 11574 11575 11576 11577 11578 11579 11580 11581 11582 11583 11584 11585 11586 11587 11588 11589 11590 11591 11592 11593 11594 11595 11596 11597 11598 11599 11600 11601 11602 11603 11604 11605 11606 11607 11608 11609
pub fn parse_start_associations_once_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartAssociationsOnceOutput,
crate::error::StartAssociationsOnceError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StartAssociationsOnceError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StartAssociationsOnceError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AssociationDoesNotExist" => crate::error::StartAssociationsOnceError {
meta: generic,
kind: crate::error::StartAssociationsOnceErrorKind::AssociationDoesNotExist({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::association_does_not_exist::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_association_does_not_exist_json_err(response.body().as_ref(), output).map_err(crate::error::StartAssociationsOnceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidAssociation" => crate::error::StartAssociationsOnceError {
meta: generic,
kind: crate::error::StartAssociationsOnceErrorKind::InvalidAssociation({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_association::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_association_json_err(response.body().as_ref(), output).map_err(crate::error::StartAssociationsOnceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StartAssociationsOnceError::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_association_does_not_exist(&self) -> bool
pub fn is_association_does_not_exist(&self) -> bool
Returns true
if the error kind is StartAssociationsOnceErrorKind::AssociationDoesNotExist
.
sourcepub fn is_invalid_association(&self) -> bool
pub fn is_invalid_association(&self) -> bool
Returns true
if the error kind is StartAssociationsOnceErrorKind::InvalidAssociation
.
Trait Implementations§
source§impl Debug for StartAssociationsOnceError
impl Debug for StartAssociationsOnceError
source§impl Display for StartAssociationsOnceError
impl Display for StartAssociationsOnceError
source§impl Error for StartAssociationsOnceError
impl Error for StartAssociationsOnceError
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<StartAssociationsOnceError> for Error
impl From<StartAssociationsOnceError> for Error
source§fn from(err: StartAssociationsOnceError) -> Self
fn from(err: StartAssociationsOnceError) -> Self
Converts to this type from the input type.