Struct aws_sdk_ssm::error::UpdateOpsItemError
source · #[non_exhaustive]pub struct UpdateOpsItemError {
pub kind: UpdateOpsItemErrorKind,
/* private fields */
}
Expand description
Error type for the UpdateOpsItem
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: UpdateOpsItemErrorKind
Kind of error that occurred.
Implementations§
source§impl UpdateOpsItemError
impl UpdateOpsItemError
sourcepub fn new(kind: UpdateOpsItemErrorKind, meta: Error) -> Self
pub fn new(kind: UpdateOpsItemErrorKind, meta: Error) -> Self
Creates a new UpdateOpsItemError
.
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 UpdateOpsItemError::Unhandled
variant from any error type.
Examples found in repository?
13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520
pub fn parse_update_ops_item_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateOpsItemOutput, crate::error::UpdateOpsItemError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateOpsItemError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateOpsItemError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemAlreadyExistsException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemAlreadyExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::ops_item_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemInvalidParameterException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemInvalidParameterException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::ops_item_invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemLimitExceededException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::ops_item_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemNotFoundException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::ops_item_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateOpsItemError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateOpsItemError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
13418 13419 13420 13421 13422 13423 13424 13425 13426 13427 13428 13429 13430 13431 13432 13433 13434 13435 13436 13437 13438 13439 13440 13441 13442 13443 13444 13445 13446 13447 13448 13449 13450 13451 13452 13453 13454 13455 13456 13457 13458 13459 13460 13461 13462 13463 13464 13465 13466 13467 13468 13469 13470 13471 13472 13473 13474 13475 13476 13477 13478 13479 13480 13481 13482 13483 13484 13485 13486 13487 13488 13489 13490 13491 13492 13493 13494 13495 13496 13497 13498 13499 13500 13501 13502 13503 13504 13505 13506 13507 13508 13509 13510 13511 13512 13513 13514 13515 13516 13517 13518 13519 13520
pub fn parse_update_ops_item_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateOpsItemOutput, crate::error::UpdateOpsItemError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateOpsItemError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateOpsItemError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemAlreadyExistsException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemAlreadyExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::ops_item_already_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_already_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemInvalidParameterException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemInvalidParameterException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::ops_item_invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemLimitExceededException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::ops_item_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OpsItemNotFoundException" => crate::error::UpdateOpsItemError {
meta: generic,
kind: crate::error::UpdateOpsItemErrorKind::OpsItemNotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::ops_item_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_ops_item_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateOpsItemError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateOpsItemError::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_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is UpdateOpsItemErrorKind::InternalServerError
.
sourcepub fn is_ops_item_already_exists_exception(&self) -> bool
pub fn is_ops_item_already_exists_exception(&self) -> bool
Returns true
if the error kind is UpdateOpsItemErrorKind::OpsItemAlreadyExistsException
.
sourcepub fn is_ops_item_invalid_parameter_exception(&self) -> bool
pub fn is_ops_item_invalid_parameter_exception(&self) -> bool
Returns true
if the error kind is UpdateOpsItemErrorKind::OpsItemInvalidParameterException
.
sourcepub fn is_ops_item_limit_exceeded_exception(&self) -> bool
pub fn is_ops_item_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is UpdateOpsItemErrorKind::OpsItemLimitExceededException
.
sourcepub fn is_ops_item_not_found_exception(&self) -> bool
pub fn is_ops_item_not_found_exception(&self) -> bool
Returns true
if the error kind is UpdateOpsItemErrorKind::OpsItemNotFoundException
.