Address comments
This commit is contained in:
parent
91552ae73b
commit
07b3d60efa
|
|
@ -126,6 +126,16 @@ Whether to ignore HTTPS errors when sending network requests.
|
||||||
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.
|
Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is exceeded.
|
||||||
Defaults to `20`. Pass `0` to not follow redirects.
|
Defaults to `20`. Pass `0` to not follow redirects.
|
||||||
|
|
||||||
|
## method: RequestOptions.setMaxRetries
|
||||||
|
* since: v1.46
|
||||||
|
- returns: <[RequestOptions]>
|
||||||
|
|
||||||
|
### param: RequestOptions.setMaxRetries.maxRetries
|
||||||
|
* since: v1.46
|
||||||
|
- `maxRetries` <[int]>
|
||||||
|
|
||||||
|
Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
|
|
||||||
## method: RequestOptions.setMethod
|
## method: RequestOptions.setMethod
|
||||||
* since: v1.18
|
* since: v1.18
|
||||||
- returns: <[RequestOptions]>
|
- returns: <[RequestOptions]>
|
||||||
|
|
|
||||||
|
|
@ -462,7 +462,7 @@ Defaults to `20`. Pass `0` to not follow redirects.
|
||||||
* langs: js, python, csharp
|
* langs: js, python, csharp
|
||||||
- `maxRetries` <[int]>
|
- `maxRetries` <[int]>
|
||||||
|
|
||||||
Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
|
|
||||||
## evaluate-expression
|
## evaluate-expression
|
||||||
- `expression` <[string]>
|
- `expression` <[string]>
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ export abstract class APIRequestContext extends SdkObject {
|
||||||
// Retry on connection reset only.
|
// Retry on connection reset only.
|
||||||
if (e.code !== 'ECONNRESET')
|
if (e.code !== 'ECONNRESET')
|
||||||
throw e;
|
throw e;
|
||||||
progress.log(`Received ECONNRESET, will retry after ${backoff}ms.`);
|
progress.log(` Received ECONNRESET, will retry after ${backoff}ms.`);
|
||||||
await new Promise(f => setTimeout(f, backoff));
|
await new Promise(f => setTimeout(f, backoff));
|
||||||
backoff *= 2;
|
backoff *= 2;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
packages/playwright-core/types/types.d.ts
vendored
12
packages/playwright-core/types/types.d.ts
vendored
|
|
@ -15964,7 +15964,7 @@ export interface APIRequestContext {
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error
|
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error
|
||||||
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
*/
|
*/
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
@ -16070,7 +16070,7 @@ export interface APIRequestContext {
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error
|
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error
|
||||||
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
*/
|
*/
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
@ -16156,7 +16156,7 @@ export interface APIRequestContext {
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error
|
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error
|
||||||
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
*/
|
*/
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
@ -16242,7 +16242,7 @@ export interface APIRequestContext {
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error
|
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error
|
||||||
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
*/
|
*/
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
@ -16370,7 +16370,7 @@ export interface APIRequestContext {
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error
|
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error
|
||||||
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
*/
|
*/
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
@ -16456,7 +16456,7 @@ export interface APIRequestContext {
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error are retried. An error
|
* Maximum number of times socket errors should be retried. Currently only `ECONNRESET` error is retried. An error
|
||||||
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
* will be thrown if the limit is exceeded. Defaults to `5`. Pass `0` to disable retries.
|
||||||
*/
|
*/
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue