[Vuejs]-Laravel-Vue: How can I use try-catch block to catch validation exception in Validation Requests?

0👍

Try it like this :

axios.post('storeProduct', data, 
        {
            headers : header(state)
        })
  .then(response => console.log(response.data))
  .catch(error => {
    if (error.response) {
      console.log("you are at error");
      console.log(error.response);
    }
  });

Leave a comment