Open devinpitcher opened 4 years ago
I don't think there's an easy way to support that correctly.
error.request
is the original outgoing request based on the adapter implementation.
require('axios').get('https://example.com/foo').catch((err) => console.error(err.request.url))
> undefined
require('axios').get('https://example.com/foo').catch((err) => console.error(err.request.responseURL))
> undefined
require('axios').get('https://example.com/foo').catch((err) => console.error(err.request.responseUrl))
> undefined
require('axios').get('https://example.com/foo', {adapter: 'fetch'}).catch((err) => console.error(err.request.url))
> 'https://example.com/foo'
responseUrl or responseURL both don't exist at least on node.
Fixes #168
Adds the
request
object to the error. This is important and follows the way that Axios handles errors.