molnarg / node-http2

An HTTP/2 client and server implementation for node.js
MIT License
1.79k stars 185 forks source link

ECONNRESET #216

Open shabinaz opened 8 years ago

shabinaz commented 8 years ago

I am using this library to post messages to APNS (Apple push notification server). I can successfully post and get esponses but when there is an ECONNRESET error (probably due to idle connection), it is neither caught at http2req.on with the request nor in the callback for the response with a response.on('error'.... Code snippet below:- callback = function (response) { .... response.on('error', function (){console.log("GET request error")}); res.end(); }); var req = http2.request(options, callback); req.write(http2Request.body); req.end(); req.on('error', (e) => { console.trace(e); throw e; });

I would like to catch the error so that I can handle the same without the node js client crashing.

ghost commented 8 years ago

I too faced the same issue while using APNS after the connection was idle for very long time.

Error: write ECONNRESET

liutian commented 7 years ago

me too