title: How Can I use error function in Nuxt Plugin?
body: <p>I'm using Nuxt and <a href="https://github.com/nuxt-community/axios-module" rel="nofollow noreferrer">axios-module</a>.</p>
  
  <p>I trying to global error handling by axios global interceptor.</p>
  
  <p>How Can I use error function in Nuxt Plugin?</p>
  
  <pre><code>// ~/plugins/axios.js
  
  export default function ({ $axios, store, redirect, error }) {
   $axios
   .onError(apiError =&gt; {
     error({statusCode: '403', message: 'test'}) // It's not work.
     redirect('http://google.com') // It's work.
    })
  }
  </code></pre>
  
  <p>redirect is working. but error not work. just display <a href="https://i.stack.imgur.com/6O5T4.png" rel="nofollow noreferrer">server error page</a>.</p>