Axios. How to get error response even when api return 404 error, in try catch finally
问题 for e.g. (async() => { let apiRes = null; try { apiRes = await axios.get('https://silex.edgeprop.my/api/v1/a'); } catch (err) { console.error(err); } finally { console.log(apiRes); } })(); in finally , apiRes will return null. Even when the api get a 404 response, there is still useful information in the response that I would like to use. How can I use the error response in finally when axios throws error. https://jsfiddle.net/jacobgoh101/fdvnsg6u/1/ 回答1: According to the documentation, the