Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error: ECONNRESET, Connection reset by peer #124

Closed
cmadsen opened this Issue · 2 comments

3 participants

@cmadsen

How do I handle

Error: ECONNRESET, Connection reset by peer
at Socket._writeImpl (net.js:159:14)
at Socket._writeOut (net.js:444:25)
at Socket.flush (net.js:523:24)
at Socket._onWritable (net.js:603:12)
at IOWatcher.onWritable as callback

when doing a request({uri:'...'},function(error, response, body){})

I expected the callback to activated with something in the error param

@cliffano

CMIIW, I think Request traps ECONNRESET then retries.
https://github.com/mikeal/request/blob/master/main.js#L188

Maybe that's why you're not seeing the error, because in that case Request won't emit an error.

@mikeal
Owner

actually, that retry only happens with the "forever" agent.

this is actually a different issue, we emit "error" but the callback error handler doesn't handle request emitted errors. there is another ticket on this, closing this one.

@mikeal mikeal closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.