Better errors handling for user controller

This commit is contained in:
Bubka
2020-01-13 23:10:32 +01:00
parent 289b36d9d0
commit efc3f5d61e
8 changed files with 22 additions and 15 deletions

View File

@ -183,7 +183,10 @@
})
.catch(error => {
if (error.response.status === 404) {
this.$router.push({name: '404', params: { err : error.response }});
this.$router.push({name: '404', params: { err : error.response.data.error }});
}
else {
this.$router.push({ name: 'genericError', params: { err: error.response.data.message } });
}
});
},
@ -214,7 +217,7 @@
this.$router.go('/login');
})
.catch(error => {
this.$router.push({ name: 'error' });
this.$router.push({ name: 'genericError', params: { err: error.response.data.message } });
});
}
}