Skip to content

Commit

Permalink
Fix handle error message
Browse files Browse the repository at this point in the history
The endpoint return different structure of error messages in different
scenarios.

Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Feb 29, 2024
1 parent c7d71f5 commit c7d39bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Components/Request/RequestSignature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ export default {
emit('libresign:show-visible-elements')
})
.catch(({ response }) => {
showError(response.data.message)
if (response.data.message) {
showError(response.data.message)
} else if (response.data.errors) {
response.data.errors.forEach(error => showError(error))
}
})
this.hasLoading = false
},
Expand Down

0 comments on commit c7d39bd

Please sign in to comment.