@samitouri / QOSami-HFS / commits / c37d4ee1

fix: yet some EIO errors when the process is killed

Massimo Melina committed May 5, 2025 at 23:43 UTC c37d4ee16dd68a6729332f1c1799912fb2ae3481
1 file changed +1 -1
src/index.ts
+1 -1
@@ -64,7 +64,7 @@ function errorHandler(err:Error & { code:string, path:string }) {
64 }
65
66 process.on('uncaughtException', (err: any) => {
67 - if (err.syscall !== 'watch' && err.code !== 'ECONNRESET')
67 + if (err.syscall !== 'watch' && err.code !== 'ECONNRESET' && err.code !== 'EIO') // EIO seems to happen when the terminal is closed
68 try { console.error("uncaught:", err) }
69 catch {} // in case we are writing to a closed terminal, we may throw with "write eio at afterwritedispatched", causing an infinite loop
70 })