I am using the library request to post data but I constantly get the error ECONNRESET even though I have an error event handler for it. Sometimes my code does indeed handle the error, but not everytime.
I have this in a loop:
request.post(url, {form:{data}}).on('error',
function(err){
if(err === 'ECONNRESET'){
console.log('ECONNRESET')
}
})
And, as described, I still get this error:
throw er; // Unhandled 'error' event
^ Error: read ECONNRESET