diff --git a/documentation/7-retry.md b/documentation/7-retry.md index e36ceb432..166ea54ce 100644 --- a/documentation/7-retry.md +++ b/documentation/7-retry.md @@ -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` diff --git a/documentation/8-errors.md b/documentation/8-errors.md index c338eafea..94ee628f6 100644 --- a/documentation/8-errors.md +++ b/documentation/8-errors.md @@ -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`