Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/sdk-reference/error-handling/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ error and the operation details.
DOE[DurableOperationError]
DOE --> StepError
DOE --> CallbackError
DOE --> CallbackTimeoutError
DOE --> CallbackSubmitterError
CallbackError --> CallbackExternalError
CallbackError --> CallbackTimeoutError
CallbackError --> CallbackSubmitterError
DOE --> InvokeError
DOE --> ChildContextError
DOE --> PromiseCombinatorError
DOE --> WaitForConditionError
SIE["StepInterruptedError (retryStrategy callback only)"]
```
Expand All @@ -74,6 +76,18 @@ error and the operation details.
subclass corresponds to a specific operation type. The `cause` property holds the
original error your code threw.

`CallbackError` is the parent class for callback failures. `CallbackExternalError`
reports a failure the external entity sent through
`SendDurableExecutionCallbackFailure`. `CallbackTimeoutError` signals a callback
that exceeded its timeout. `CallbackSubmitterError` wraps a failure raised inside
the submitter function. The SDK throws `CallbackError` directly only for internal
callback failures that do not match a more specific subclass. Catch `CallbackError`
to handle every callback failure with a single branch.

`PromiseCombinatorError` wraps failures from the durable promise combinators
`context.promise.all`, `context.promise.allSettled`, `context.promise.any`, and
`context.promise.race`.

The TypeScript SDK passes `StepInterruptedError` to your
`retryStrategy(error, attempt)` callback when Lambda interrupts an at-most-once step
before the SDK checkpoints the result. From `context.step(...)` the SDK throws a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,26 @@ import {
DurableOperationError,
StepError,
CallbackError,
CallbackExternalError,
CallbackTimeoutError,
CallbackSubmitterError,
InvokeError,
ChildContextError,
PromiseCombinatorError,
WaitForConditionError,
StepInterruptedError,
} from "@aws/durable-execution-sdk-js";

// DurableOperationError
// StepError: step failed after retries exhausted
// CallbackError: callback operation failed
// CallbackTimeoutError: callback timed out
// CallbackSubmitterError: callback submitter failed
// InvokeError: invoke operation failed
// ChildContextError: child context failed
// WaitForConditionError: wait-for-condition failed
// StepError: step failed after retries exhausted
// CallbackError: parent class for callback failures
// CallbackExternalError: external entity reported failure
// CallbackTimeoutError: callback timed out
// CallbackSubmitterError: submitter function failed
// InvokeError: invoke operation failed
// ChildContextError: child context failed
// PromiseCombinatorError: context.promise.{all,allSettled,any,race} failed
// WaitForConditionError: wait-for-condition failed
//
// StepInterruptedError: internal sentinel. The SDK passes it to your
// retryStrategy(error, attempt) callback when Lambda interrupts an
Expand All @@ -28,10 +32,12 @@ export {
DurableOperationError,
StepError,
CallbackError,
CallbackExternalError,
CallbackTimeoutError,
CallbackSubmitterError,
InvokeError,
ChildContextError,
PromiseCombinatorError,
WaitForConditionError,
StepInterruptedError,
};