DeepLcom / deepl-node

Official Node.js library for the DeepL language translation API.
MIT License
370 stars 22 forks source link

Increasing "socket hang up" errors when updated to 1.13 #47

Open tomasvts opened 5 months ago

tomasvts commented 5 months ago

Describe the bug Since we updated to version node-deepl to version 1.13.0, and follow-redirects 1.15.6 (because of a security update) we've seen an increasing number of errors of the type "socket hang up". We've never seen this error before.

image
node_modules/axios/dist/node/axios.cjs:836:14 in AxiosError.from
node_modules/axios/dist/node/axios.cjs:3086:25 in RedirectableRequest.handleRequestError
node:events:539:35 in RedirectableRequest.emit
node_modules/follow-redirects/index.js:38:24 in eventHandlers.<computed>
node:events:527:28 in ClientRequest.emit
node:_http_client:478:9 in TLSSocket.socketOnEnd
node:events:539:35 in TLSSocket.emit
node:internal/streams/readable:1344:12 in endReadableNT
node:internal/process/task_queues:82:21 in process.processTicksAndRejections
node_modules/axios/dist/node/axios.cjs:3876:41 in Axios.request
node:internal/process/task_queues:95:5 in process.processTicksAndRejections
node_modules/deepl-node/dist/client.js:180:30 in async Function.sendAxiosRequest
node_modules/deepl-node/dist/client.js:143:28 in async HttpClient.sendRequestWithBackoff
node_modules/deepl-node/dist/index.js:363:41 in async Translator.translateText

To Reproduce We haven't found a way to reproduce.

Expected behavior Do not fail with "socket hang up", maybe another error more descriptive.

Additional info The update of follow-redirects was because this security update:

Bump follow-redirects from 1.15.4 to 1.15.6 (#161) Bumps follow-redirects from 1.15.4 to 1.15.6. - Release notes - Commits