From 20988a235628c863358f9dcd4cd9797953f6c2a3 Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Tue, 19 Apr 2022 21:49:59 +0200 Subject: [PATCH] fix(error handler): add default handler to econnreset --- src/_handlers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/_handlers.ts b/src/_handlers.ts index 6cdefd79..9d3be970 100644 --- a/src/_handlers.ts +++ b/src/_handlers.ts @@ -11,6 +11,10 @@ export function init(proxy: httpProxy, option: Options): void { proxy.on(eventName, handlers[eventName]); } + proxy.on('econnreset', (err, req, res, target) => { + logger.error(`[HPM] ECONNRESET: %s`, err); + }); + logger.debug('[HPM] Subscribed to http-proxy events:', Object.keys(handlers)); }