Skip to content

Commit

Permalink
Support retrying on HTTP 500
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak authored and sindresorhus committed Aug 11, 2018
1 parent 2cdb3ed commit a3e77de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions advanced-creation.md
Expand Up @@ -59,17 +59,18 @@ const defaults = {
retry: {
retries: 2,
methods: [
'get',
'put',
'head',
'delete',
'options',
'trace'
'GET',
'PUT',
'HEAD',
'DELETE',
'OPTIONS',
'TRACE'
],
statusCodes: [
408,
413,
429,
500,
502,
503,
504
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -209,7 +209,7 @@ Type: `number` `Object`<br>
Default:
- retries: `2`
- methods: `GET` `PUT` `HEAD` `DELETE` `OPTIONS` `TRACE`
- statusCodes: [`408`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) [`413`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) [`429`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) [`502`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) [`504`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504)
- statusCodes: [`408`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) [`413`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) [`429`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) [`500`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) [`502`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) [`504`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504)
- maxRetryAfter: `undefined`

An object representing `retries`, `methods`, `statusCodes` and `maxRetryAfter` fields for the time until retry, allowed methods, allowed status codes and maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time.
Expand Down
1 change: 1 addition & 0 deletions source/index.js
Expand Up @@ -18,6 +18,7 @@ const defaults = {
408,
413,
429,
500,
502,
503,
504
Expand Down

0 comments on commit a3e77de

Please sign in to comment.