Struct aws_sdk_ssm::error::TerminateSessionError
source · #[non_exhaustive]pub struct TerminateSessionError {
pub kind: TerminateSessionErrorKind,
/* private fields */
}
Expand description
Error type for the TerminateSession
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: TerminateSessionErrorKind
Kind of error that occurred.
Implementations§
source§impl TerminateSessionError
impl TerminateSessionError
sourcepub fn new(kind: TerminateSessionErrorKind, meta: Error) -> Self
pub fn new(kind: TerminateSessionErrorKind, meta: Error) -> Self
Creates a new TerminateSessionError
.
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 TerminateSessionError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 12087)
12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111
pub fn parse_terminate_session_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::TerminateSessionOutput, crate::error::TerminateSessionError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::TerminateSessionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::TerminateSessionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::TerminateSessionError {
meta: generic,
kind: crate::error::TerminateSessionErrorKind::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::TerminateSessionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::TerminateSessionError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the TerminateSessionError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 12109)
12079 12080 12081 12082 12083 12084 12085 12086 12087 12088 12089 12090 12091 12092 12093 12094 12095 12096 12097 12098 12099 12100 12101 12102 12103 12104 12105 12106 12107 12108 12109 12110 12111
pub fn parse_terminate_session_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::TerminateSessionOutput, crate::error::TerminateSessionError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::TerminateSessionError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::TerminateSessionError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalServerError" => crate::error::TerminateSessionError {
meta: generic,
kind: crate::error::TerminateSessionErrorKind::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::TerminateSessionError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::TerminateSessionError::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 TerminateSessionErrorKind::InternalServerError
.
Trait Implementations§
source§impl Debug for TerminateSessionError
impl Debug for TerminateSessionError
source§impl Display for TerminateSessionError
impl Display for TerminateSessionError
source§impl Error for TerminateSessionError
impl Error for TerminateSessionError
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<TerminateSessionError> for Error
impl From<TerminateSessionError> for Error
source§fn from(err: TerminateSessionError) -> Self
fn from(err: TerminateSessionError) -> Self
Converts to this type from the input type.