1 try {
2 await axios.get('/bad-call')
3 } catch (error) {
4 const err = error as AxiosError
5 if (err.response) {
6 console.log(err.response.status)
7 console.log(err.response.data)
8 }
9 this.handleAxiosError(error)
10 }
1axios.get('/foo')
2 .catch(function (error) {
3 if (error.response) {
4 console.log(error.response.data);
5 console.log(error.response.status);
6 console.log(error.response.headers);
7 }
8 });