Skip to content

onRetry

onRetry(listener): () => void

Defined in: clients/http-client/src/retry-events.ts:32

Hear about every retry any client in this process is about to make, so a command line can say “retrying GitHub, attempt 2 of 3” instead of sitting silent. Returns the way to stop listening. A listener that throws is ignored: a display problem must not fail a request.

This is per process, not per client, so a command need not hand a hook to every client it builds. It relies on there being one copy of this package, which the workspace already requires; with two, retries by the other copy go unseen.

(event) => void

() => void