You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While using axios in our application we noticed that it is almost impossible to determine when an axios error is caused by a timeout. The AxiosError is as follows:
{
"config":
{
"url":redacted,
"method":"get",
"headers":{"Accept":"application/json, text/plain, */*"},
"transformRequest":[null],
"transformResponse":[null],
"timeout":2000,
"timeoutErrorMessage":"It appears that we cannot reach the backend system.\nCheck that you are connected to the correct vpn.\n\n"
},
"code":"ECONNABORTED"
}
There is no message in the error json (this might be caused by a scoping error in the enhanceError method here
The response object is undefined so we cannot check the status or statusText or data in the response.
To Reproduce
Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question
Expected behavior
I expect to receive an error code that reflects that this request timed out and receive the timeout error message in the error.message or error.toJSON().message or error.response.data.message.
Describe the bug
While using axios in our application we noticed that it is almost impossible to determine when an axios error is caused by a timeout. The
AxiosError
is as follows:There is no
message
in the error json (this might be caused by a scoping error in theenhanceError
method hereThe
response
object isundefined
so we cannot check thestatus
orstatusText
ordata
in the response.To Reproduce
Code snippet to reproduce, ideally that will work by pasting into something like https://npm.runkit.com/axios, a hosted solution, or a repository that illustrates the issue. If your problem is not reproducible, please file under Support or Usage Question
Expected behavior
I expect to receive an error code that reflects that this request timed out and receive the timeout error message in the error.message or error.toJSON().message or error.response.data.message.
Environment:
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
The text was updated successfully, but these errors were encountered: