Skip to content

Commit

Permalink
Clarify retry.statusCode
Browse files Browse the repository at this point in the history
Fixes #1694
  • Loading branch information
szmarczak committed Jul 13, 2021
1 parent c601899 commit 45230e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions documentation/7-retry.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ The allowed methods to retry on.

**Type: `number[]`**

**Note:**
> - Only [**unsuccessful**](8-errors.md#) requests are retried. In order to retry successful requests, use an [`afterResponse`](9-hooks.md#afterresponse) hook.
The allowed [HTTP status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) to retry on.

#### `errorCodes`
Expand Down
9 changes: 8 additions & 1 deletion documentation/8-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ When the request body is a stream and an error occurs while reading from that st

**Code: `ERR_NON_2XX_3XX_RESPONSE`**

When the server response code is not 2xx nor 3xx if [`options.followRedirect`](2-options.md#followredirect) is `true`, but always except for 304. Includes a `response` property.
When the request is unsuccessful.

A request is successful when the status code of the final request is `2xx` or `3xx`.

When [following redirects](2-options.md#followredirect), a request is successful **only** when the status code of the final request is `2xx`.

**Note:**
> - `304` responses are always considered successful.
### `MaxRedirectsError`

Expand Down

0 comments on commit 45230e3

Please sign in to comment.