Closed silentjohnny closed 8 months ago
When a non-HTTP error occurs, e.g., a timeout, the err instance does not contain a response.
err
response
This means that this:
const { response: res } = err; if (res.status === 401) {
will fail because of res being undefined
res
undefined
Thanks for catching this and submitting a PR @silentjohnny!
Merged and published to npm as 1.1.1. 🎉
npm
1.1.1
When a non-HTTP error occurs, e.g., a timeout, the
err
instance does not contain aresponse
.This means that this:
will fail because of
res
beingundefined