#[non_exhaustive]pub struct OperationError { /* private fields */ }Expand description
The top-level error type returned by DurableFuture.
Wraps a typed per-operation cause accessible via kind().
Match on the kind to determine the specific failure mode, and walk
source() to reach the underlying cause:
on the live path that is the escaping error itself (downcastable to its
concrete type), and after a replay it is a ReplayedFailure carrying
the recorded wire fields.
§Examples
use aws_durable_execution_sdk::{OperationError, OperationErrorKind};
fn handle_error(err: &OperationError) {
match err.kind() {
OperationErrorKind::Step(step_err) => {
// The step's escaping error is reachable through source().
if let Some(cause) = std::error::Error::source(step_err) {
tracing::error!(%cause, "step failed");
}
}
// `{:#}` prints the full chain; `{}` prints one frame.
_ => tracing::error!(error = format!("{err:#}"), "operation failed"),
}
}Implementations§
Source§impl OperationError
impl OperationError
Sourcepub fn kind(&self) -> &OperationErrorKind
pub fn kind(&self) -> &OperationErrorKind
Returns the specific error kind for this operation failure.
§Examples
use aws_durable_execution_sdk::{OperationError, OperationErrorKind, StepErrorKind};
let err = OperationError::__test_error();
if let OperationErrorKind::Step(step_err) = err.kind() {
assert!(matches!(step_err.kind(), StepErrorKind::ExecutionFailed { .. }));
}Sourcepub fn operation_id(&self) -> Option<&str>
pub fn operation_id(&self) -> Option<&str>
The wire ID of the operation that failed, when known.
Sourcepub fn status(&self) -> Option<&str>
pub fn status(&self) -> Option<&str>
The operation’s wire status (for example FAILED or TIMED_OUT),
when known.
Sourcepub fn wire(&self) -> Option<&WireError>
pub fn wire(&self) -> Option<&WireError>
The wire failure record for this error, when one exists.
On a replayed failure this is the record read back from the
execution history; on a live failure it is the record the SDK
wrote. None for errors that never reached the wire (for example
a serialization failure before checkpointing).
Trait Implementations§
Source§impl Debug for OperationError
impl Debug for OperationError
Source§impl Display for OperationError
impl Display for OperationError
Source§impl Error for OperationError
impl Error for OperationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for OperationError
impl !UnwindSafe for OperationError
impl Forget for OperationError
impl Freeze for OperationError
impl Move for OperationError
impl Send for OperationError
impl Sync for OperationError
impl Unpin for OperationError
impl UnsafeUnpin for OperationError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more