[Vuejs]-Why axios does't catch errors from server response?

0👍

Think the syntax for the catch block is not correct

your code

axios.post('acd/' + this.number + '/' + this.date)
                .then((response) => {
                    this.setData(response['data'])
                }).catch(err => {
                    console.log("this dont display")
                });

suppose to be

axios.post('acd/' + this.number + '/' + this.date)
                .then((response) => {
                    this.setData(response['data'])
                }).catch((err) => {
                    console.log(err)
                });

Leave a comment