How can I get the status code from an http error in Axios?

前端 未结 10 1946
南旧
南旧 2020-11-28 02:27

This may seem stupid, but I\'m trying to get the error data when a request fails in Axios.

axios.get(\'foo.com\')
    .then((response) => {})
    .catch((         


        
10条回答
  •  北海茫月
    2020-11-28 02:57

    This is a known bug, try to use "axios": "0.13.1"

    https://github.com/mzabriskie/axios/issues/378

    I had the same problem so I ended up using "axios": "0.12.0". It works fine for me.

提交回复
热议问题