When an error is thrown by Axios, it's handy to have access to the HTTP status and response headers returned from the API, without needing to parse the HTTP status code from the error message.
This makes it so when HTTP responses are caught by the generic HTTP client's handleErrors function, the response's status code and headers are included alongside the response's data in the error that is yielded.
When an error is thrown by Axios, it's handy to have access to the HTTP status and response headers returned from the API, without needing to parse the HTTP status code from the error message.
This makes it so when HTTP responses are caught by the generic HTTP client's
handleErrors
function, the response's status code and headers are included alongside the response's data in the error that is yielded.That'll make step-level error handling easier.