From 3c96007131aebdfbd8ffff9d24ed3d6a704d5424 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 13 Apr 2013 23:38:29 +0800 Subject: [PATCH] Don't quit browser when get fatal js error. --- browser/atom/atom.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/browser/atom/atom.js b/browser/atom/atom.js index ab74fd7b7996..94aa6489e1bc 100644 --- a/browser/atom/atom.js +++ b/browser/atom/atom.js @@ -1 +1,7 @@ -console.log(process.argv); +process.on('uncaughtException', function(error) { + console.error('uncaughtException:'); + if (error.stack) + console.error(error.stack); + else + console.error(error.name + ': ' + error.message); +});