yapople icon indicating copy to clipboard operation
yapople copied to clipboard

ECONNRESET during fetch

Open rjborba opened this issue 3 years ago • 2 comments

Hi! First of all I would like to thank you for this pretty good and simple LIB.

I'm getting sometimes ECONNRESET exception due my poor network. And even if the requested code is wrapped by a try-catch block, it seems to crash my node app. I guess some actions are happening in a different thread inside the, for example, retrieve method. Would it be possible?

rjborba avatar Mar 02 '21 21:03 rjborba

Are you still having the issue? I know the cause and workaround, but thinking of making a PR for a better fix. It comes from emit('error') and you are not catching the error to fix it, you need to add on error handler in your client

Client.on('error', () => ()) for e.g.

Prabhakar-Poudel avatar Sep 15 '21 10:09 Prabhakar-Poudel

It is been a while since I used the lib, but It is still good to know the way to fix it. Thanks you!

rjborba avatar Sep 15 '21 13:09 rjborba