From f07d8c567773876a7b4ea189df971cb8bcdc39c2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 25 May 2014 16:16:29 +0800 Subject: [PATCH] Quit when get uncaughtException in specs. --- spec/static/main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/spec/static/main.js b/spec/static/main.js index af22bb5c1..cafc397b0 100644 --- a/spec/static/main.js +++ b/spec/static/main.js @@ -32,10 +32,13 @@ ipc.on('echo', function(event, msg) { event.returnValue = msg; }); -process.on('uncaughtException', function(error) { - console.log(error); - window.openDevTools(); -}); +if (process.argv[1] == '--ci') { + process.removeAllListeners('uncaughtException'); + process.on('uncaughtException', function(error) { + console.error(error, error.stack); + process.exit(1); + }); +} app.on('window-all-closed', function() { app.quit();