hgouveia / node-downloader-helper

A simple http file downloader for node.js
MIT License
253 stars 54 forks source link

fix: make retry cover errors during headers and during body #116

Open mitom opened 8 months ago

mitom commented 8 months ago

I believe this fixes one part of the issue in #115 and maybe helps #113 a bit as well, not sure if it entirely closes either but maybe one step closer.

The logic behind it is fairly simple - make the error handling during parsing the resposne be the same as the error handling of the http event listeners, the __onError function already takes care of setting the state to failed when we're out of retries and also emitting the error.

mitom commented 8 months ago

Actually it looks like this is not ready to merge, the retry counter doesn't seem to be increasing so it goes infinitely.

hgouveia commented 8 months ago

Actually it looks like this is not ready to merge, the retry counter doesn't seem to be increasing so it goes infinitely.

ok ok, i will check all these when i have some time including #115 and #113 , but unfortunately i am still unable to do a proper check and fix it, i will let you know as soon is possible

mitom commented 8 months ago

Thank you, and no worries - I'm trying to help as much as I can, not trying to rush you!