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
termination_reason: TerminationReasonThe reason for termination
Invocation
Invocation error that triggers Lambda retry.
Fields
termination_reason: TerminationReasonThe reason for termination
Checkpoint
Checkpoint error for checkpoint failures.
Fields
Callback
Callback error for callback-specific failures.
Fields
NonDeterministic
Non-deterministic execution error for replay mismatches.
Fields
Validation
Validation error for invalid configuration or arguments.
SerDes
Serialization/deserialization error.
Suspend
Suspend execution signal to pause and return control to Lambda runtime.
OrphanedChild
Orphaned child error when a child operation’s parent has completed.
Fields
UserCode
User code error wrapping errors from user-provided closures.
Fields
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
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
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
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.
Implementations§
Source§impl DurableError
impl DurableError
Sourcepub fn invocation(message: impl Into<String>) -> Self
pub fn invocation(message: impl Into<String>) -> Self
Creates a new Invocation error.
Sourcepub fn checkpoint_retriable(message: impl Into<String>) -> Self
pub fn checkpoint_retriable(message: impl Into<String>) -> Self
Creates a new retriable Checkpoint error.
Sourcepub fn checkpoint_non_retriable(message: impl Into<String>) -> Self
pub fn checkpoint_non_retriable(message: impl Into<String>) -> Self
Creates a new non-retriable Checkpoint error.
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Creates a new Validation error.
Sourcepub fn suspend_until(timestamp: f64) -> Self
pub fn suspend_until(timestamp: f64) -> Self
Creates a new Suspend signal with a scheduled timestamp.
Sourcepub fn size_limit(message: impl Into<String>) -> Self
pub fn size_limit(message: impl Into<String>) -> Self
Sourcepub fn size_limit_with_details(
message: impl Into<String>,
actual_size: usize,
max_size: usize,
) -> Self
pub fn size_limit_with_details( message: impl Into<String>, actual_size: usize, max_size: usize, ) -> Self
Creates a new SizeLimit error with size details.
§Arguments
message- Description of the size limit violationactual_size- The actual size that exceeded the limitmax_size- The maximum allowed size
Sourcepub fn throttling(message: impl Into<String>) -> Self
pub fn throttling(message: impl Into<String>) -> Self
Sourcepub fn throttling_with_retry_delay(
message: impl Into<String>,
retry_after_ms: u64,
) -> Self
pub fn throttling_with_retry_delay( message: impl Into<String>, retry_after_ms: u64, ) -> Self
Creates a new Throttling error with retry delay.
§Arguments
message- Description of the throttling conditionretry_after_ms- Suggested retry delay in milliseconds
Sourcepub fn resource_not_found(message: impl Into<String>) -> Self
pub fn resource_not_found(message: impl Into<String>) -> Self
Creates a new ResourceNotFound error.
§Arguments
message- Description of what resource was not found
Sourcepub fn resource_not_found_with_id(
message: impl Into<String>,
resource_id: impl Into<String>,
) -> Self
pub fn resource_not_found_with_id( message: impl Into<String>, resource_id: impl Into<String>, ) -> Self
Creates a new ResourceNotFound error with resource ID.
§Arguments
message- Description of what resource was not foundresource_id- The identifier of the resource that was not found
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Returns true if this is a Checkpoint error that is retriable.
Sourcepub fn is_suspend(&self) -> bool
pub fn is_suspend(&self) -> bool
Returns true if this is a Suspend signal.
Sourcepub fn is_invalid_checkpoint_token(&self) -> bool
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.
Sourcepub fn is_size_limit(&self) -> bool
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.
Sourcepub fn is_throttling(&self) -> bool
pub fn is_throttling(&self) -> bool
Returns true if this is a Throttling error.
Throttling errors ARE retriable with exponential backoff.
Sourcepub fn is_resource_not_found(&self) -> bool
pub fn is_resource_not_found(&self) -> bool
Returns true if this is a ResourceNotFound error.
Resource not found errors are NOT retriable.
Sourcepub fn get_retry_after_ms(&self) -> Option<u64>
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
impl Debug for DurableError
Source§impl Display for DurableError
impl Display for DurableError
Source§impl Error for DurableError
impl Error for DurableError
1.30.0 · 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
Source§impl From<&DurableError> for ErrorObject
impl From<&DurableError> for ErrorObject
Source§fn from(error: &DurableError) -> Self
fn from(error: &DurableError) -> Self
Source§impl From<Error> for DurableError
impl From<Error> for DurableError
Auto Trait Implementations§
impl Freeze for DurableError
impl RefUnwindSafe for DurableError
impl Send for DurableError
impl Sync for DurableError
impl Unpin for DurableError
impl UnsafeUnpin for DurableError
impl UnwindSafe for DurableError
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.