From 1c5b9693edfe7ca2cca3e2a38282eb02df557818 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Mon, 11 May 2020 21:48:14 +0800 Subject: [PATCH] feat: Add proxy error console log. --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index da61a1e0..2d7a257f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -196,6 +196,9 @@ export default function (app: Application, watchFile: string | string[], conf: M }); const proxyHTTP = httpProxy.createProxyServer({}); + proxyHTTP.on('error', (err) => { + console.error(`${color.red_b.black(` Proxy Failed: ${err.name}`)} ${err.message || ''} ${err.stack || ''} !!`); + }); Object.keys(proxyListeners).forEach(event => { proxyHTTP.on(event, proxyListeners[event]); });