superagent
superagent copied to clipboard
request error not returning 504 status or response details
I have a POST request similar to:
superagent.post(url)
.set('Content-Type', 'application/json')
.set('Accept', 'application/json')
.set('Authorization', `Bearer ${accessToken}`)
.query(query)
.send(body)
.then(() => {
//...
})
.catch((error) => {
console.log('response', error.response)
console.log('status', error.status)
console.log('error', error)
//...
})
- the request is done on a AWS API Gateway endpoint which is closing the call with a timeout error after 29 sec
- the server response (in Chrome DevTools / Network) contains the 504 status code:

- next logs (from the call above) are printed to the console:

Why there is no response
or status
attribute on the error as in documentation?