#[non_exhaustive]pub struct DescribeStackInstanceError {
pub kind: DescribeStackInstanceErrorKind,
/* private fields */
}Expand description
Error type for the DescribeStackInstance 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: DescribeStackInstanceErrorKindKind of error that occurred.
Implementations§
source§impl DescribeStackInstanceError
impl DescribeStackInstanceError
sourcepub fn new(kind: DescribeStackInstanceErrorKind, meta: Error) -> Self
pub fn new(kind: DescribeStackInstanceErrorKind, meta: Error) -> Self
Creates a new DescribeStackInstanceError.
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 DescribeStackInstanceError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 1354)
1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
pub fn parse_describe_stack_instance_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DescribeStackInstanceOutput,
crate::error::DescribeStackInstanceError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeStackInstanceError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DescribeStackInstanceError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"StackInstanceNotFoundException" => crate::error::DescribeStackInstanceError {
meta: generic,
kind: crate::error::DescribeStackInstanceErrorKind::StackInstanceNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::stack_instance_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_stack_instance_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeStackInstanceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"StackSetNotFoundException" => crate::error::DescribeStackInstanceError {
meta: generic,
kind: crate::error::DescribeStackInstanceErrorKind::StackSetNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::stack_set_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_stack_set_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeStackInstanceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DescribeStackInstanceError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DescribeStackInstanceError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 1395)
1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
pub fn parse_describe_stack_instance_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DescribeStackInstanceOutput,
crate::error::DescribeStackInstanceError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::DescribeStackInstanceError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DescribeStackInstanceError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"StackInstanceNotFoundException" => crate::error::DescribeStackInstanceError {
meta: generic,
kind: crate::error::DescribeStackInstanceErrorKind::StackInstanceNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::stack_instance_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_stack_instance_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeStackInstanceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"StackSetNotFoundException" => crate::error::DescribeStackInstanceError {
meta: generic,
kind: crate::error::DescribeStackInstanceErrorKind::StackSetNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::stack_set_not_found_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_stack_set_not_found_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::DescribeStackInstanceError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::DescribeStackInstanceError::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_stack_instance_not_found_exception(&self) -> bool
pub fn is_stack_instance_not_found_exception(&self) -> bool
Returns true if the error kind is DescribeStackInstanceErrorKind::StackInstanceNotFoundException.
sourcepub fn is_stack_set_not_found_exception(&self) -> bool
pub fn is_stack_set_not_found_exception(&self) -> bool
Returns true if the error kind is DescribeStackInstanceErrorKind::StackSetNotFoundException.
Trait Implementations§
source§impl Debug for DescribeStackInstanceError
impl Debug for DescribeStackInstanceError
source§impl Display for DescribeStackInstanceError
impl Display for DescribeStackInstanceError
source§impl Error for DescribeStackInstanceError
impl Error for DescribeStackInstanceError
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<DescribeStackInstanceError> for Error
impl From<DescribeStackInstanceError> for Error
source§fn from(err: DescribeStackInstanceError) -> Self
fn from(err: DescribeStackInstanceError) -> Self
Converts to this type from the input type.