Skip to content

fix(sdk): preserve errorData across runInChildContext boundaries#525

Open
t-d-d wants to merge 1 commit intoaws:mainfrom
t-d-d:claude/prepare-durable-execution-pr-vaDRP
Open

fix(sdk): preserve errorData across runInChildContext boundaries#525
t-d-d wants to merge 1 commit intoaws:mainfrom
t-d-d:claude/prepare-durable-execution-pr-vaDRP

Conversation

@t-d-d
Copy link
Copy Markdown

@t-d-d t-d-d commented May 5, 2026

When runInChildContext re-wraps a replayed DurableOperationError, the handler did new ChildContextError(originalError.message, originalError) without forwarding errorData, so the typed payload disappeared after the second boundary crossing -- breaking error-classification flows that depend on it (operator-cancellation signals, failure categories, etc.).

Forward originalError.errorData at both wrap sites (run-in-child-context-handler.ts:224,435). The wrapper now carries the payload in-memory and on the wire, all the way up the boundary stack.

User-supplied errorMapper callbacks must forward errorData themselves if they want it preserved -- e.g.
errorMapper: (e) => new MyError(e.message, e, e.errorData).

Fixes #524

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

When `runInChildContext` re-wraps a replayed `DurableOperationError`, the
handler did `new ChildContextError(originalError.message, originalError)`
without forwarding `errorData`, so the typed payload disappeared after
the second boundary crossing -- breaking error-classification flows that
depend on it (operator-cancellation signals, failure categories, etc.).

Forward `originalError.errorData` at both wrap sites
(`run-in-child-context-handler.ts:224,435`). The wrapper now carries the
payload in-memory and on the wire, all the way up the boundary stack.

User-supplied `errorMapper` callbacks must forward `errorData` themselves
if they want it preserved -- e.g.
`errorMapper: (e) => new MyError(e.message, e, e.errorData)`.

Fixes aws#524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: DurableOperationError.toErrorObject loses errorData across runInChildContext boundaries

2 participants