Version
Reproduction link
https://github.com/msonowal/nuxt-bug-reproduce-link
Steps to reproduce
add this in
plugins dir make file name it axios.js
and add the link in nuxt config plugins array visit any route whose axios calls are 404
axios.js file content below
export default function({ $axios, error }) {
$axios.onError((responseError) => {
if (responseError.response.status === 404) {
error({ statusCode: 404, message: 'Post not found from interceptor' })
}
})
}
What is expected ?
show the error response with 404 code as defined in the nuxt app Post not found from interceptor
but
not redirect to 301
What is actually happening?
it is showing default nuxt error
NuxtServerError
Request failed with status code 404
throw responseErrorafter if ? - Fahmi