#[non_exhaustive]pub struct RecordHandlerProgressError {
pub kind: RecordHandlerProgressErrorKind,
/* private fields */
}Expand description
Error type for the RecordHandlerProgress 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: RecordHandlerProgressErrorKindKind of error that occurred.
Implementations§
source§impl RecordHandlerProgressError
impl RecordHandlerProgressError
sourcepub fn new(kind: RecordHandlerProgressErrorKind, meta: Error) -> Self
pub fn new(kind: RecordHandlerProgressErrorKind, meta: Error) -> Self
Creates a new RecordHandlerProgressError.
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 RecordHandlerProgressError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 3005)
2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051
pub fn parse_record_handler_progress_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::RecordHandlerProgressOutput,
crate::error::RecordHandlerProgressError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::RecordHandlerProgressError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::RecordHandlerProgressError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidStateTransition" => crate::error::RecordHandlerProgressError {
meta: generic,
kind: crate::error::RecordHandlerProgressErrorKind::InvalidStateTransitionException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_state_transition_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_state_transition_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::RecordHandlerProgressError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ConditionalCheckFailed" => crate::error::RecordHandlerProgressError {
meta: generic,
kind: crate::error::RecordHandlerProgressErrorKind::OperationStatusCheckFailedException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::operation_status_check_failed_exception::Builder::default(
);
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_operation_status_check_failed_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::RecordHandlerProgressError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::RecordHandlerProgressError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the RecordHandlerProgressError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 3049)
2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051
pub fn parse_record_handler_progress_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::RecordHandlerProgressOutput,
crate::error::RecordHandlerProgressError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::RecordHandlerProgressError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::RecordHandlerProgressError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InvalidStateTransition" => crate::error::RecordHandlerProgressError {
meta: generic,
kind: crate::error::RecordHandlerProgressErrorKind::InvalidStateTransitionException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_state_transition_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_state_transition_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::RecordHandlerProgressError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ConditionalCheckFailed" => crate::error::RecordHandlerProgressError {
meta: generic,
kind: crate::error::RecordHandlerProgressErrorKind::OperationStatusCheckFailedException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::operation_status_check_failed_exception::Builder::default(
);
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_operation_status_check_failed_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::RecordHandlerProgressError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::RecordHandlerProgressError::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_invalid_state_transition_exception(&self) -> bool
pub fn is_invalid_state_transition_exception(&self) -> bool
Returns true if the error kind is RecordHandlerProgressErrorKind::InvalidStateTransitionException.
sourcepub fn is_operation_status_check_failed_exception(&self) -> bool
pub fn is_operation_status_check_failed_exception(&self) -> bool
Returns true if the error kind is RecordHandlerProgressErrorKind::OperationStatusCheckFailedException.
Trait Implementations§
source§impl Debug for RecordHandlerProgressError
impl Debug for RecordHandlerProgressError
source§impl Display for RecordHandlerProgressError
impl Display for RecordHandlerProgressError
source§impl Error for RecordHandlerProgressError
impl Error for RecordHandlerProgressError
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<RecordHandlerProgressError> for Error
impl From<RecordHandlerProgressError> for Error
source§fn from(err: RecordHandlerProgressError) -> Self
fn from(err: RecordHandlerProgressError) -> Self
Converts to this type from the input type.