From 77a462373d132cc7cfb2284f583b585b99fad83b Mon Sep 17 00:00:00 2001 From: James Hilliard Date: Sun, 14 Feb 2021 23:43:57 -0700 Subject: [PATCH] Suppress error events. Fixes: node:events:353 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:213:20) Emitted 'error' event on Socket instance at: at emitErrorNT (node:internal/streams/destroy:188:8) at emitErrorCloseNT (node:internal/streams/destroy:153:3) at processTicksAndRejections (node:internal/process/task_queues:80:21) { errno: -54, code: 'ECONNRESET', syscall: 'read' } npm ERR! code 1 --- lib/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/utils.js b/lib/utils.js index 53e0c49..ae683b6 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -16,6 +16,7 @@ module.exports.fake_response = function fake_response(req, res) { } r.push(''); r.push(''); + res.on('error', () => {}); try { res.write(r.join('\r\n')); } catch (x) {