I use got with a retry limit of 8, so I expect that all requests will got through eventually.
But it seems like got doesn't retry on socket hang-up. I got the following error:
RequestError: socket hang up
at ClientRequest.<anonymous> (/app/node_modules/got/dist/source/core/index.js:953:111)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:327:22)
at ClientRequest.origin.emit (/app/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
at TLSSocket.socketOnEnd (_http_client.js:493:9)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at connResetException (internal/errors.js:607:14)
at TLSSocket.socketOnEnd (_http_client.js:493:23)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Expected behavior
It should retry on socket hang-up, unfortunately I don't have all the details of the error since I only log the message and the stack trace.
Code to reproduce
I will try to create a repro, but unsure when the error occurs. Is it the server that closes the connection?
Checklist
[ ] I have read the documentation.
[ ] I have tried my code with the latest version of Node.js and Got.
Describe the bug
Actual behavior
I use got with a retry limit of 8, so I expect that all requests will got through eventually. But it seems like got doesn't retry on socket hang-up. I got the following error:
Expected behavior
It should retry on socket hang-up, unfortunately I don't have all the details of the error since I only log the message and the stack trace.
Code to reproduce
I will try to create a repro, but unsure when the error occurs. Is it the server that closes the connection?
Checklist