Skip to main content

DurableError

Enum DurableError 

Source
pub enum DurableError {
Show 14 variants Execution { message: String, termination_reason: TerminationReason, }, Invocation { message: String, termination_reason: TerminationReason, }, Checkpoint { message: String, is_retriable: bool, aws_error: Option<AwsError>, }, Callback { message: String, callback_id: Option<String>, }, NonDeterministic { message: String, operation_id: Option<String>, }, Validation { message: String, }, SerDes { message: String, }, Suspend { scheduled_timestamp: Option<f64>, }, OrphanedChild { message: String, operation_id: String, }, UserCode { message: String, error_type: String, stack_trace: Option<String>, }, SizeLimit { message: String, actual_size: Option<usize>, max_size: Option<usize>, }, Throttling { message: String, retry_after_ms: Option<u64>, }, ResourceNotFound { message: String, resource_id: Option<String>, }, Configuration { message: String, },
}
Expand description

The main error type for the AWS Durable Execution SDK.

This enum covers all possible error conditions that can occur during durable execution workflows.

§Examples

Creating common error types:

use durable_execution_sdk::DurableError;

// Execution error (fails workflow without retry)
let exec_err = DurableError::execution("Order validation failed");
assert!(!exec_err.is_retriable());

// Validation error
let val_err = DurableError::validation("Invalid input format");

// Retriable checkpoint error
let cp_err = DurableError::checkpoint_retriable("Temporary network issue");
assert!(cp_err.is_retriable());

Checking error types:

use durable_execution_sdk::DurableError;

let err = DurableError::size_limit("Payload too large");
assert!(err.is_size_limit());
assert!(!err.is_throttling());

let throttle_err = DurableError::throttling("Rate limit exceeded");
assert!(throttle_err.is_throttling());

Variants§

§

Execution

Execution error that returns FAILED status without Lambda retry.

Fields

§message: String

Error message describing what went wrong

§termination_reason: TerminationReason

The reason for termination

§

Invocation

Invocation error that triggers Lambda retry.

Fields

§message: String

Error message describing what went wrong

§termination_reason: TerminationReason

The reason for termination

§

Checkpoint

Checkpoint error for checkpoint failures.

Fields

§message: String

Error message describing what went wrong

§is_retriable: bool

Whether this error is retriable

§aws_error: Option<AwsError>

Optional underlying AWS error details

§

Callback

Callback error for callback-specific failures.

Fields

§message: String

Error message describing what went wrong

§callback_id: Option<String>

The callback ID if available

§

NonDeterministic

Non-deterministic execution error for replay mismatches.

Fields

§message: String

Error message describing the mismatch

§operation_id: Option<String>

The operation ID where the mismatch occurred

§

Validation

Validation error for invalid configuration or arguments.

Fields

§message: String

Error message describing the validation failure

§

SerDes

Serialization/deserialization error.

Fields

§message: String

Error message describing the serialization failure

§

Suspend

Suspend execution signal to pause and return control to Lambda runtime.

Fields

§scheduled_timestamp: Option<f64>

Optional timestamp when execution should resume

§

OrphanedChild

Orphaned child error when a child operation’s parent has completed.

Fields

§message: String

Error message describing the orphaned state

§operation_id: String

The operation ID of the orphaned child

§

UserCode

User code error wrapping errors from user-provided closures.

Fields

§message: String

Error message from the user code

§error_type: String

The type of error

§stack_trace: Option<String>

Optional stack trace

§

SizeLimit

Size limit exceeded error for payload size violations.

This error occurs when:

  • Checkpoint payload exceeds the maximum allowed size
  • Response payload exceeds Lambda’s 6MB limit
  • History size exceeds service limits

This error is NOT retriable - the operation should fail without retry.

Fields

§message: String

Error message describing the size limit violation

§actual_size: Option<usize>

The actual size that exceeded the limit (in bytes)

§max_size: Option<usize>

The maximum allowed size (in bytes)

§

Throttling

Throttling error for rate limit exceeded.

This error occurs when the AWS API rate limit is exceeded. This error IS retriable with exponential backoff.

Fields

§message: String

Error message describing the throttling condition

§retry_after_ms: Option<u64>

Suggested retry delay in milliseconds (if provided by AWS)

§

ResourceNotFound

Resource not found error for missing executions or operations.

This error occurs when:

  • The durable execution ARN does not exist
  • The operation ID is not found
  • The Lambda function does not exist

This error is NOT retriable.

Fields

§message: String

Error message describing what resource was not found

§resource_id: Option<String>

The resource identifier that was not found

§

Configuration

Configuration error for missing or invalid SDK configuration.

This error occurs when:

  • No AWS credentials provider is configured
  • HTTP client construction fails
  • Required configuration values are missing

This error is NOT retriable.

Fields

§message: String

Error message describing the configuration issue

Implementations§

Source§

impl DurableError

Source

pub fn execution(message: impl Into<String>) -> DurableError

Creates a new Execution error.

Source

pub fn invocation(message: impl Into<String>) -> DurableError

Creates a new Invocation error.

Source

pub fn checkpoint_retriable(message: impl Into<String>) -> DurableError

Creates a new retriable Checkpoint error.

Source

pub fn checkpoint_non_retriable(message: impl Into<String>) -> DurableError

Creates a new non-retriable Checkpoint error.

Source

pub fn validation(message: impl Into<String>) -> DurableError

Creates a new Validation error.

Source

pub fn serdes(message: impl Into<String>) -> DurableError

Creates a new SerDes error.

Source

pub fn suspend() -> DurableError

Creates a new Suspend signal.

Source

pub fn suspend_until(timestamp: f64) -> DurableError

Creates a new Suspend signal with a scheduled timestamp.

Source

pub fn size_limit(message: impl Into<String>) -> DurableError

Creates a new SizeLimit error.

§Arguments
  • message - Description of the size limit violation
Source

pub fn size_limit_with_details( message: impl Into<String>, actual_size: usize, max_size: usize, ) -> DurableError

Creates a new SizeLimit error with size details.

§Arguments
  • message - Description of the size limit violation
  • actual_size - The actual size that exceeded the limit
  • max_size - The maximum allowed size
Source

pub fn throttling(message: impl Into<String>) -> DurableError

Creates a new Throttling error.

§Arguments
  • message - Description of the throttling condition
Source

pub fn throttling_with_retry_delay( message: impl Into<String>, retry_after_ms: u64, ) -> DurableError

Creates a new Throttling error with retry delay.

§Arguments
  • message - Description of the throttling condition
  • retry_after_ms - Suggested retry delay in milliseconds
Source

pub fn resource_not_found(message: impl Into<String>) -> DurableError

Creates a new ResourceNotFound error.

§Arguments
  • message - Description of what resource was not found
Source

pub fn resource_not_found_with_id( message: impl Into<String>, resource_id: impl Into<String>, ) -> DurableError

Creates a new ResourceNotFound error with resource ID.

§Arguments
  • message - Description of what resource was not found
  • resource_id - The identifier of the resource that was not found
Source

pub fn is_retriable(&self) -> bool

Returns true if this is a Checkpoint error that is retriable.

Source

pub fn is_suspend(&self) -> bool

Returns true if this is a Suspend signal.

Source

pub fn is_invalid_checkpoint_token(&self) -> bool

Returns true if this is an invalid checkpoint token error.

Invalid checkpoint token errors occur when:

  • The token has already been consumed by a previous checkpoint
  • The token is malformed or expired

These errors are retriable because Lambda will provide a fresh token on the next invocation.

Source

pub fn is_size_limit(&self) -> bool

Returns true if this is a SizeLimit error.

Size limit errors are NOT retriable - the operation should fail.

Source

pub fn is_throttling(&self) -> bool

Returns true if this is a Throttling error.

Throttling errors ARE retriable with exponential backoff.

Source

pub fn is_resource_not_found(&self) -> bool

Returns true if this is a ResourceNotFound error.

Resource not found errors are NOT retriable.

Source

pub fn get_retry_after_ms(&self) -> Option<u64>

Returns the suggested retry delay for throttling errors.

Returns None if this is not a throttling error or if no retry delay was provided.

Trait Implementations§

Source§

impl Debug for DurableError

Source§

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

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

impl Display for DurableError

Source§

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

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

impl Error for DurableError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<&DurableError> for ErrorObject

Source§

fn from(error: &DurableError) -> ErrorObject

Converts to this type from the input type.
Source§

impl From<Box<dyn Error>> for DurableError

Source§

fn from(error: Box<dyn Error>) -> DurableError

Converts to this type from the input type.
Source§

impl From<Box<dyn Error + Send + Sync>> for DurableError

Source§

fn from(error: Box<dyn Error + Send + Sync>) -> DurableError

Converts to this type from the input type.
Source§

impl From<DurableError> for TestError

Source§

fn from(source: DurableError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for DurableError

Source§

fn from(error: Error) -> DurableError

Converts to this type from the input type.
Source§

impl From<Error> for DurableError

Source§

fn from(error: Error) -> DurableError

Converts to this type from the input type.

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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