Axios-module: onError - Not Returning Error Code

Created on 20 Oct 2018  路  3Comments  路  Source: nuxt-community/axios-module

Version

v5.1.0

Reproduction link

https://codesandbox.io/

Steps to reproduce

I am trying to use onError helper as mentioned in documentation (https://axios.nuxtjs.org/helpers) But it is not returning error code. It is simply just returning string message "Network Error"

What is expected ?

Should return error object with status code and status message.

What is actually happening?

Only returning generic error message.

This bug report is available on Nuxt community (#c176)
bug-report

All 3 comments

I get the same issue.

Same issue here.

So I did some quick googling and realized Axios returns 'Network error' when it didn't get a response from the web service it made the request to. In my case it was related to a CORS issue on my API. After solving that issue the onError helper works fine.
See also: https://github.com/axios/axios/issues/383

Summarized; this is not a bug, just the way Axios handles errors without responses.

@pi0 can closed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ruudboon picture ruudboon  路  5Comments

ealves-pt picture ealves-pt  路  3Comments

simllll picture simllll  路  6Comments

seanwash picture seanwash  路  6Comments

mclighter picture mclighter  路  3Comments