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
We have an intermittent issue on a service making external HTTPS API calls.
The actual issue isn't particularly relevant, but our problem is that Axios swallowed most of the underlying AggregateError making diagnosis hard.
Node was throwing an AggregateError combining a number of ETIMEDOUT and EHOSTUNREACH errors, contained in a .errors collection - but the parent AggregateError object had a code ETIMEDOUT (Node just uses the code of the first nested error), a blank message, and a name AggregateError
We were logging just the message and the code (as our payloads have sensitive data so we avoided logging the whole Error object - it contains the payload!) and this made it quite difficult to work out that this was more than just a time out.
Eventually I managed to get a stack trace which made things clearer:
AggregateError
at AxiosError.from (file:///workspace/node_modules/axios/lib/core/AxiosError.js:92:14)
at RedirectableRequest.handleRequestError (file:///workspace/node_modules/axios/lib/adapters/http.js:620:25)
at RedirectableRequest.emit (node:events:530:35)
at RedirectableRequest.emit (node:domain:489:12)
at eventHandlers.<computed> (/workspace/node_modules/follow-redirects/index.js:49:24)
at ClientRequest.emit (node:events:518:28)
at ClientRequest.emit (node:domain:489:12)
at emitErrorEvent (node:_http_client:101:11)
at TLSSocket.socketErrorListener (node:_http_client:504:5)
at TLSSocket.emit (node:events:518:28)
at Axios.request (file:///workspace/node_modules/axios/lib/core/Axios.js:45:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async requestAuthToken (file:///workspace/dist/src/auth-endpoint-handler.js:58:12)
at async file:///workspace/dist/src/auth-endpoint-handler.js:25:27
(if it helps we are using Axios 1.7.7 on NodeJS 20.18)
To Reproduce
No response
Code snippet
No response
Expected behavior
It'd be good to have an Error.message indicating that the problem is an AggregateError - or more generally, if wrapping an Error that has no message, setting a message to the name of the underlying error (or some other informative message)
Axios Version
1.7.7
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
20.18.1
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
Running via a Google Cloud Run Function on GCP
The text was updated successfully, but these errors were encountered:
Describe the bug
We have an intermittent issue on a service making external HTTPS API calls.
The actual issue isn't particularly relevant, but our problem is that Axios swallowed most of the underlying AggregateError making diagnosis hard.
Node was throwing an AggregateError combining a number of ETIMEDOUT and EHOSTUNREACH errors, contained in a
.errors
collection - but the parent AggregateError object had a codeETIMEDOUT
(Node just uses the code of the first nested error), a blank message, and a nameAggregateError
We were logging just the message and the code (as our payloads have sensitive data so we avoided logging the whole Error object - it contains the payload!) and this made it quite difficult to work out that this was more than just a time out.
Eventually I managed to get a stack trace which made things clearer:
(if it helps we are using Axios 1.7.7 on NodeJS 20.18)
To Reproduce
No response
Code snippet
No response
Expected behavior
It'd be good to have an
Error.message
indicating that the problem is an AggregateError - or more generally, if wrapping an Error that has no message, setting a message to the name of the underlying error (or some other informative message)Axios Version
1.7.7
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
20.18.1
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: