npm / npm-registry-client

http://npm.im/npm-registry-client
ISC License
264 stars 108 forks source link

Ensure late errors on requests are passed through properly #148

Closed iarna closed 7 years ago

iarna commented 7 years ago

Without this patch, if an error is received on the request object AFTER response has been emitted then we retry the request without notifying the response that it failed.

This makes it so that the error is passed along to the response object and leaves any further retries as the responsibility of the caller.

othiym23 commented 7 years ago

LGTM. :sheep::rocket::fire:

I'd have to go spelunking in request's commits from a few months ago, but I do think they changed error-handling a few months ago, which is why this has suddenly become an issue.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.04%) to 90.465% when pulling 533f3dc36afd8b0b53d0a29f48c46d6a270c88f3 on late-errors into 2244b9e4544d46577316bab777895aba266f7729 on master.