Skip to content

retryNetworkOperation

retryNetworkOperation<T>(maxAttempts, callback): Promise<T>

Defined in: src/http-api/utils.ts:152

Retries a network operation run in a callback.

T

number

maximum attempts to try

() => Promise<T>

callback that returns a promise of the network operation. If rejected with ConnectionError, it will be retried by calling the callback again.

Promise<T>

the result of the network operation

ConnectionError If after maxAttempts the callback still throws ConnectionError