axios.request(options).then(function (response) { console.log(response.data); }).catch(function (error) { console.error(error); }); code example
Example: axios try catch get error status cocxe
try {
await axios.get('/bad-call')
} catch (error) {
const err = error as AxiosError
if (err.response) {
console.log(err.response.status)
console.log(err.response.data)
}
this.handleAxiosError(error)
}