Skip to main content

CallbackErrorKind

Enum CallbackErrorKind 

Source
#[non_exhaustive]
pub enum CallbackErrorKind {
#[non_exhaustive]
TimedOut,
#[non_exhaustive]
HeartbeatTimedOut,
#[non_exhaustive]
ExternalFailure,
#[non_exhaustive]
DeserializationFailed,
#[non_exhaustive]
Internal,
#[non_exhaustive]
SubmitterFailed, }
Expand description

Specific kinds of callback failures.

The external/internal split separates user-attributable errors (timeout, invalid payload) from SDK/service failures.

§Examples

use aws_durable_execution_sdk::CallbackErrorKind;

fn is_external(kind: &CallbackErrorKind) -> bool {
    matches!(
        kind,
        CallbackErrorKind::TimedOut { .. }
            | CallbackErrorKind::HeartbeatTimedOut { .. }
            | CallbackErrorKind::ExternalFailure { .. }
            | CallbackErrorKind::SubmitterFailed { .. }
    )
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

#[non_exhaustive]
TimedOut

The callback timed out waiting for completion.

The enclosing error’s OperationError::wire record keeps the callback record’s message and error data. An absent or empty message becomes Callback timed out. From wait_for_callback, the wire record has type Callback.Timeout.

§

#[non_exhaustive]
HeartbeatTimedOut

The callback heartbeat timed out (no keep-alive received in time).

The service records a heartbeat timeout as a TIMED_OUT callback with the error type Callback.Heartbeat. Both create_callback and wait_for_callback report it with this kind. The enclosing error’s OperationError::wire record keeps the callback record’s message and error data. An absent or empty message becomes Callback timed out. From wait_for_callback, the wire record has type Callback.Heartbeat.

§

#[non_exhaustive]
ExternalFailure

The callback record is FAILED, CANCELLED or STOPPED, whatever its error type: an external system failed the callback, or the service cancelled or stopped it.

The failure fields travel as wire data. Read them from the error’s source() (a ReplayedFailure) or from OperationError::wire. From create_callback, the wire record keeps the callback record’s error type, error data and stack trace. It keeps a nonempty message and otherwise uses Callback failed. From wait_for_callback, the wire record has the type Callback.ExternalFailure. It keeps the callback record’s error data and the same normalized message. The callback operation’s stored record keeps the external type and original message field.

§

#[non_exhaustive]
DeserializationFailed

The callback payload could not be deserialized.

This is a payload decode failure that the serdes did not mark with RetryableSerdesError; a marked failure ends the invocation instead. From create_callback, create_callback(..).await succeeds, and Callback::result or Callback::spawn_result returns this permanent error, live and on replay. From wait_for_callback, the outer operation’s record has already succeeded with the raw payload, and this error is the decode of that payload with the operation’s serdes. So every invocation that reads the record fails the same way.

§

#[non_exhaustive]
Internal

An internal SDK or service error occurred.

§

#[non_exhaustive]
SubmitterFailed

The wait_for_callback submitter failed and its retry strategy stopped.

Live, source() is the submitter step’s OperationError. On replay, source() is a ReplayedFailure holding the recorded outer failure.

Trait Implementations§

Source§

impl Debug for CallbackErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CallbackErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more