Struct aws_sdk_ssm::error::GetParameterHistoryError
source · #[non_exhaustive]pub struct GetParameterHistoryError {
pub kind: GetParameterHistoryErrorKind,
/* private fields */
}
Expand description
Error type for the GetParameterHistory
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: GetParameterHistoryErrorKind
Kind of error that occurred.
Implementations§
source§impl GetParameterHistoryError
impl GetParameterHistoryError
sourcepub fn new(kind: GetParameterHistoryErrorKind, meta: Error) -> Self
pub fn new(kind: GetParameterHistoryErrorKind, meta: Error) -> Self
Creates a new GetParameterHistoryError
.
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 GetParameterHistoryError::Unhandled
variant from any error type.
Examples found in repository?
7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489
pub fn parse_get_parameter_history_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetParameterHistoryOutput,
crate::error::GetParameterHistoryError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetParameterHistoryError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetParameterHistoryError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::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::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidKeyId" => crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::InvalidKeyId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_key_id::Builder::default();
let _ = response;
output =
crate::json_deser::deser_structure_crate_error_invalid_key_id_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidNextToken" => {
crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::InvalidNextToken({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_next_token::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_json_err(response.body().as_ref(), output).map_err(crate::error::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"ParameterNotFound" => crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::ParameterNotFound({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::parameter_not_found::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_parameter_not_found_json_err(response.body().as_ref(), output).map_err(crate::error::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetParameterHistoryError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetParameterHistoryError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489
pub fn parse_get_parameter_history_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetParameterHistoryOutput,
crate::error::GetParameterHistoryError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetParameterHistoryError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetParameterHistoryError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::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::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidKeyId" => crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::InvalidKeyId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_key_id::Builder::default();
let _ = response;
output =
crate::json_deser::deser_structure_crate_error_invalid_key_id_json_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidNextToken" => {
crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::InvalidNextToken({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_next_token::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_next_token_json_err(response.body().as_ref(), output).map_err(crate::error::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"ParameterNotFound" => crate::error::GetParameterHistoryError {
meta: generic,
kind: crate::error::GetParameterHistoryErrorKind::ParameterNotFound({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::parameter_not_found::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_parameter_not_found_json_err(response.body().as_ref(), output).map_err(crate::error::GetParameterHistoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetParameterHistoryError::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 GetParameterHistoryErrorKind::InternalServerError
.
sourcepub fn is_invalid_key_id(&self) -> bool
pub fn is_invalid_key_id(&self) -> bool
Returns true
if the error kind is GetParameterHistoryErrorKind::InvalidKeyId
.
sourcepub fn is_invalid_next_token(&self) -> bool
pub fn is_invalid_next_token(&self) -> bool
Returns true
if the error kind is GetParameterHistoryErrorKind::InvalidNextToken
.
sourcepub fn is_parameter_not_found(&self) -> bool
pub fn is_parameter_not_found(&self) -> bool
Returns true
if the error kind is GetParameterHistoryErrorKind::ParameterNotFound
.