Skip to content

Consolidate error handling #120

@yaythomas

Description

@yaythomas

overview

Currently exceptions from a step raise as a CallableRuntimeError.

https://github.com/aws/aws-durable-execution-sdk-python/blob/3aea45710cc8da739f6d6ddb3b4120002b35f81d/src/aws_durable_execution_sdk_python/state.py#L188C1-L201C53

A recent refactor in Ts introduced some different/new error types.

ChildContextError Consistency:

  • Always wrap errors in ChildContextError in executeChildContext
  • Preserve original error message and pass error as cause
  • Handle both Error objects and non-Error values consistently
  • Add test for child context error with no Error field

StepError Consistency:

  • Wrap generic errors in StepError at handler level
  • Preserve DurableOperationError instances and specific error types
  • Add test to verify Error objects are wrapped with correct message/cause

StepInterruptedError Handling:

  • Pass StepInterruptedError to retry strategy for decision making
  • Wrap StepInterruptedError in StepError when retry is exhausted
  • Update tests to verify proper error wrapping and retry flow

per aws/aws-durable-execution-sdk-js#212

ac

  1. Add ChiildContextError + implement in ChildContext handler
  2. Add StepError + implement in Step handler (replacing CallabeRuntimeError)
  3. StepInterruptedError raises as a StepError when retries exhausted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions