retryNetworkOperation
retryNetworkOperation<
T>(maxAttempts,callback):Promise<T>
Defined in: src/http-api/utils.ts:152
Retries a network operation run in a callback.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”maxAttempts
Section titled “maxAttempts”number
maximum attempts to try
callback
Section titled “callback”() => Promise<T>
callback that returns a promise of the network operation. If rejected with ConnectionError, it will be retried by calling the callback again.
Returns
Section titled “Returns”Promise<T>
the result of the network operation
Throws
Section titled “Throws”ConnectionError If after maxAttempts the callback still throws ConnectionError