Skip to content

@statesync/core


@statesync/core / RetryReportingOptions

Interface: RetryReportingOptions

Defined in: retry.ts:159

Options for withRetryReporting, which combines retry logic with structured logging and error reporting.

Properties

logger?

ts
optional logger: Logger;

Defined in: retry.ts:174

Logger instance for emitting structured retry warnings. When provided, a warn-level message is logged for each retry attempt.


onError()?

ts
optional onError: (ctx) => void;

Defined in: retry.ts:188

Optional error hook invoked on each retry attempt.

The callback receives a SyncErrorContext with:

  • phase set to 'getSnapshot'
  • willRetry set to true
  • attempt indicating which retry this is (1-based)
  • nextDelayMs indicating the backoff delay before the next attempt

If this callback itself throws, the error is caught and logged (it does not affect the retry flow).

Parameters

ParameterType
ctxSyncErrorContext

Returns

void


policy?

ts
optional policy: RetryPolicy;

Defined in: retry.ts:168

Retry policy configuration. When omitted, the default RetryPolicy values are used.


topic

ts
topic: string;

Defined in: retry.ts:163

The topic associated with this provider, used for log context and error reporting.

Released under the MIT License.