В vue / cli 4 / vuejs 2.6.10 / vuex, 3.0.1 app я делаю запрос ax ios, и когда я получаю ошибку 404 от сервера, я хочу ее перехватить, например:
this.credentialsConfig.headers.Authorization = 'Bearer ' + this.currentLoggedUserToken
axios.get(this.apiUrl + '/adminarea/categories/' + this.category_id, this.credentialsConfig)
.then(({ data }) => {
this.categoryRow = data.categories[0]
this.is_page_loaded = true
})
.catch(error => {
console.log('error::')
console.log(error)
console.log('error.status::')
console.log(error.status) // NO VALUE
debugger
if (error.status == 404) { // tHAT DOES NOT WORK
this.showPopupMessage("Categories editor", "User # "+this.category_id+" not found !", 'warn');
this.$router.push({path: '/admin/categories'}); // TO MOVE TO OTHER ROUT!
}
console.error(error)
this.showPopupMessage('Categories Editor', error.response.data.message, 'warn')
this.is_page_loaded = true
})
Но при проверке ошибок var я не вижу никакой структуры с кодом ошибки: https://imgur.com/a/1qo527Z
Как я могу получить здесь код ошибки?
"axios": "^0.19.0",
"vue": "^2.6.10",
"vue-avatar": "^2.1.8",
"vuex": "^3.0.1"
Спасибо!