Skip to content

[Feature]: add specific err for callbacks #313

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

Labels

enhancementNew feature or request

Fields

No fields configured for Feature.

Projects

Status
In progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions