Skip to content

[Feature]: add specific err for callbacks #313

@yaythomas

Description

@yaythomas

What would you like?

aws/aws-durable-execution-sdk-js#441

Add CallbackTimeoutError and CallbackSubmitterError to provide clear, unambiguous error handling for callback operations. Replace errorClass with more flexible errorMapper in ChildConfig.

Changes:

  • Add CallbackTimeoutError for callback timeout scenarios
  • Add CallbackSubmitterError for submitter failures in waitForCallback
  • Add errorMapper to ChildConfig for flexible error type mapping
  • Remove errorClass from ChildConfig (replaced by errorMapper)
  • Update callback.ts to throw CallbackTimeoutError for TIMED_OUT status
  • Update waitForCallback to use errorMapper for consistent error types
  • Update all promise combinators to use errorMapper
  • Update fromErrorObject to reconstruct new error types
  • Export CallbackTimeoutError and CallbackSubmitterError
  • Update all tests to expect correct error types

Error types by operation:

  • createCallback timeout -> CallbackTimeoutError
  • createCallback failure -> CallbackError
  • waitForCallback timeout -> CallbackTimeoutError
  • waitForCallback failure -> CallbackError
  • waitForCallback submitter failure -> CallbackSubmitterError

Possible Implementation

No response

Is this a breaking change?

No

Does this require an RFC?

No

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions