title: How can I return error message from axios function inside Vuex action to dispatch catch(error)?
body: <p>I have an action where ajax call is made using axios,whenever the axios returns errors it gets catch by axios catch function , so i want to know if its possible to throw that same error to dispatch catch function.</p>
  
  <p>I've tried to //throw new Error("test error inside"); from inside of axios catch(error) but dispatch doesnot seem to catch the error</p>
  
  <p>Action code on vuex store</p>
  
  <pre><code>actions:{
      assignOrder(context, assign){
          axios.post('/assignOrder',assign)
                    .then((response) =&gt; {
                      console.log(response)
                    })
                    .catch((error) =&gt; {
                       //I want to throw error catched from here
                          console.log(error.response.data.errors)
                        //throw new Error("test error inside");
                      // }       
                    })
      }
  }
  </code></pre>
  
  <p>On my method on vue component</p>
  
  <pre><code>methods:{
        setAssign(){
          this.assign.order_id = this.order.id
          if(this.validate()){
            this.errors = {};
            this.$store.dispatch('assignOrder', this.assign).then(() =&gt; {
              showNotify('success','Order has been assigned')
              this.$store.dispatch('getOrders',this.active)
            })
            .catch((error) =&gt; {
               //catch the error here
                alert(error)    
              })
          }
          else{
            this.showErr = true;
          }
        },
  }
  </code></pre>
  
  <p>I want the axios to throw catch error which will catch by dispatch</p>