This repository has been archived by the owner on Jun 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(retry): be more specific about when we retry
Retries are now attempted only for specific known errors. All other will fail fast. Additionally, requests will be retried on 404s and rate-limiting status codes 420 (for Twitter) and 429, along with the original 408 and 500-level error codes. All other codes will continue to fast-path to request failure. One big effect of this is that requests are no longer retried on ENOTFOUND -- that is, the getaddrinfo DNS failure error. When this happens, the problem is almost certainly that the user is currently offline. In combination with conditional requests and the cache rules, this means that make-fetch-happen now has effectively an "offline mode", where the `default` cache mode will only fail on ENOTFOUND if there is no cache entry available. As before, if we're using a stale locally-cached request due to an error (again, such as ENOTFOUND), a `Warning: 111` header will be added to the response, so you can check that field to figure out what make-fetch-happen did.
- Loading branch information