Handle ECONNRESET in the same way as EPIPE

This commit is contained in:
Simon Detheridge 2020-02-04 13:58:45 +00:00
parent 7663e9689e
commit 8e45a62e32

View file

@ -141,7 +141,8 @@ if Settings.shutdownDrainTimeWindow?
if Settings.errors?.catchUncaughtErrors
process.removeAllListeners('uncaughtException')
process.on 'uncaughtException', (error) ->
if error.code == 'EPIPE'
if ['EPIPE', 'ECONNRESET'].includes(error.code)
Metrics.inc('disconnected_write')
return logger.warn err: error, 'attempted to write to disconnected client'
logger.error err: error, 'uncaught exception'
if Settings.errors?.shutdownOnUncaughtError