Closed balduinofernando closed 4 years ago
When you use async/await you must use a try/catch block:
async saveCategory() {
try {
const response = await this.form.post(....)
console.log(response.data)
} catch (e) {
console.log(e, e.response.data)
}
}
Let's say I have this code:
The problem I had was that the catch block is not working. For example I can't show the error using SweetAlert or a custom Flash utility on the .catch(error=>{}) Block.
Is there any way of doing this?