Struggling a bit to set up error handling with vuex. There seems to be quite a few ways to do so and little documentation on proper error handling. I\'ve been experimenting with
Use Promise in action
Promise
action
Example in vuex:
NEW_AUTH({ commit }) { return new Promise((resolve, reject) => { this.$axios.$get('/token').then((res) => { ... resolve(); }).catch((error) => { reject(error); }) }) }
In page:
this.$store.dispatch('NEW_AUTH') .then(() => ... ) .catch((error) => ... )