ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.59k stars 1.33k forks source link

request error not returning 504 status or response details #1601

Open DavidFlorin opened 4 years ago

DavidFlorin commented 4 years ago

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)
        //...
      })
image image

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