about summary refs log tree commit diff
path: root/streaming
diff options
context:
space:
mode:
Diffstat (limited to 'streaming')
-rw-r--r--streaming/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/streaming/index.js b/streaming/index.js
index 31c597cf0..198eac1ae 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -563,12 +563,14 @@ const startWorker = (workerId) => {
 
   const onError = (err) => {
     log.error(err);
+    server.close();
+    process.exit(0);
   };
 
   process.on('SIGINT', onExit);
   process.on('SIGTERM', onExit);
   process.on('exit', onExit);
-  process.on('error', onError);
+  process.on('uncaughtException', onError);
 };
 
 throng({