Skip to content

Commit

Permalink
fix error handling in reportErrorView
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo Chambon committed Oct 16, 2023
1 parent e987fc2 commit eb88cc7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/theses/ReportErrorView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,11 @@ function validate() {
grecaptcha.ready(function () {
loading.value = true;
grecaptcha.execute('6LchRDMnAAAAAFSPyM8p7mvowBkOiQC6WYahnsV-', { action: 'submit' }).then(function (token) {
postSignalerErreur(buildJSONToPost(token)).then(() => {
emit('done');
postSignalerErreur(buildJSONToPost(token)).then((res) => {
const error = res.error.value;
if (error) {
errMsg.value = "Erreur : " + error.data.message;
}
}).catch((err) => {
errMsg.value = "Erreur : " + err.response.data.message;
}).finally(() => { loading.value = false; });
Expand Down

0 comments on commit eb88cc7

Please sign in to comment.