avoid annoying ECONNRESET in console
Massimo Melina committed
May 30, 2024 at 10:00 UTC
23dccebfe330d7f7555b76b9e7864b092956bf3a
1 file changed
+2
-2
src/index.ts
+2
-2
@@ -64,8 +64,8 @@ function errorHandler(err:Error & { code:string, path:string }) {
64
console.error(new Date().toLocaleString('en-uk'), 'server error', err)
65
}
66
67
-process.on('uncaughtException', err => {
68
- if ((err as any).syscall !== 'watch')
67
+process.on('uncaughtException', (err: any) => {
68
+ if (err.syscall !== 'watch' && err.code !== 'ECONNRESET')
69
console.error("uncaught:", err)
70
})
71