#[non_exhaustive]pub struct StartInstanceRefreshError {
pub kind: StartInstanceRefreshErrorKind,
/* private fields */
}Expand description
Error type for the StartInstanceRefresh 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: StartInstanceRefreshErrorKindKind of error that occurred.
Implementations§
source§impl StartInstanceRefreshError
impl StartInstanceRefreshError
sourcepub fn new(kind: StartInstanceRefreshErrorKind, meta: Error) -> Self
pub fn new(kind: StartInstanceRefreshErrorKind, meta: Error) -> Self
Creates a new StartInstanceRefreshError.
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 StartInstanceRefreshError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 4061)
4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122
pub fn parse_start_instance_refresh_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartInstanceRefreshOutput,
crate::error::StartInstanceRefreshError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::StartInstanceRefreshError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StartInstanceRefreshError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InstanceRefreshInProgress" => crate::error::StartInstanceRefreshError {
meta: generic,
kind: crate::error::StartInstanceRefreshErrorKind::InstanceRefreshInProgressFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::instance_refresh_in_progress_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_instance_refresh_in_progress_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::StartInstanceRefreshError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"LimitExceeded" => {
crate::error::StartInstanceRefreshError {
meta: generic,
kind: crate::error::StartInstanceRefreshErrorKind::LimitExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_limit_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::StartInstanceRefreshError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"ResourceContention" => crate::error::StartInstanceRefreshError {
meta: generic,
kind: crate::error::StartInstanceRefreshErrorKind::ResourceContentionFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::resource_contention_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_resource_contention_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::StartInstanceRefreshError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StartInstanceRefreshError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StartInstanceRefreshError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 4120)
4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122
pub fn parse_start_instance_refresh_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartInstanceRefreshOutput,
crate::error::StartInstanceRefreshError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::StartInstanceRefreshError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StartInstanceRefreshError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InstanceRefreshInProgress" => crate::error::StartInstanceRefreshError {
meta: generic,
kind: crate::error::StartInstanceRefreshErrorKind::InstanceRefreshInProgressFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::instance_refresh_in_progress_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_instance_refresh_in_progress_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::StartInstanceRefreshError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"LimitExceeded" => {
crate::error::StartInstanceRefreshError {
meta: generic,
kind: crate::error::StartInstanceRefreshErrorKind::LimitExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::limit_exceeded_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_limit_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::StartInstanceRefreshError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"ResourceContention" => crate::error::StartInstanceRefreshError {
meta: generic,
kind: crate::error::StartInstanceRefreshErrorKind::ResourceContentionFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::resource_contention_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_resource_contention_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::StartInstanceRefreshError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StartInstanceRefreshError::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_instance_refresh_in_progress_fault(&self) -> bool
pub fn is_instance_refresh_in_progress_fault(&self) -> bool
Returns true if the error kind is StartInstanceRefreshErrorKind::InstanceRefreshInProgressFault.
sourcepub fn is_limit_exceeded_fault(&self) -> bool
pub fn is_limit_exceeded_fault(&self) -> bool
Returns true if the error kind is StartInstanceRefreshErrorKind::LimitExceededFault.
sourcepub fn is_resource_contention_fault(&self) -> bool
pub fn is_resource_contention_fault(&self) -> bool
Returns true if the error kind is StartInstanceRefreshErrorKind::ResourceContentionFault.
Trait Implementations§
source§impl Debug for StartInstanceRefreshError
impl Debug for StartInstanceRefreshError
source§impl Display for StartInstanceRefreshError
impl Display for StartInstanceRefreshError
source§impl Error for StartInstanceRefreshError
impl Error for StartInstanceRefreshError
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<StartInstanceRefreshError> for Error
impl From<StartInstanceRefreshError> for Error
source§fn from(err: StartInstanceRefreshError) -> Self
fn from(err: StartInstanceRefreshError) -> Self
Converts to this type from the input type.