API reference@evolu/commonTask › RetryOptions

Defined in: packages/common/src/Task.ts:3855

Options for retry.

Properties

onRetry?

readonly optional onRetry?: (attempt: RetryAttempt<E, Output>) => void;

Defined in: packages/common/src/Task.ts:3875

Runs before each scheduled retry.

attempt is the failed attempt that caused this retry, not the upcoming attempt number. The callback runs after RetryOptions.shouldRetry and the Schedule approve a retry, and before the retry delay. The callback must not throw: a thrown exception is a defect that panics the Run tree.

shouldRetry?

readonly optional shouldRetry?: Predicate<E>;

Defined in: packages/common/src/Task.ts:3864

Decides whether a domain error should schedule another attempt.

Returning false stops retrying and returns RetryError. The original error is stored as lastError instead of returned directly. The predicate must not throw: a thrown exception is a defect that panics the Run tree.