title: Catch Axios exception in Vuex store and throw it to Vue.js method
body: <p>How to catch <strong>axios</strong> exceptions in <strong>vuex</strong> store and throw it to <strong>vue.js</strong> method ? My goal is to get this exception to be able to reset computed values bound to <code>input</code> using <code>this.$forceUpdate()</code>.</p>
  
  <p>In my method, I have this:</p>
  
  <pre><code>methods: {
      mymet: _.debounce(
          function(table, id, key, event) {
              const value = event.target.value;
              this.$store.dispatch('UPDATE_TRANSACTIONS_ITEM', { table, id, key, value }).then(response =&gt; {
                  event.target.classList.remove("is-invalid")
                  event.target.classList.add("is-valid")
              }, error =&gt; {
                  console.error("Got nothing from server. Prompt user to check internet connection and try again")
                  this.$forceUpdate();
              })
          }, 500
      )
  }
  </code></pre>
  
  <p>In my vuex store, I have this:</p>
  
  <pre><code>const actions = {
      UPDATE_TRANSACTIONS_ITEM ({ commit }, data) {
          let company = {
              [data.key]: data.value
          }
          axios.put(`/api/companies/${data.id}`, { company }).then( function ( response ) {
              commit('SET_TRANSACTIONS_ITEM_UPDATE', { profile: data })
          }).catch(function (error) {
              throw error
          })
      }
  }
  
  const mutations = {
      SET_TRANSACTIONS_ITEM_UPDATE (state, { profile }) {
          state.company_data[profile.key] = profile.value
      },
  }
  </code></pre>