From: Cheng Zhao Date: Sat, 13 Apr 2013 15:38:29 +0000 (+0800) Subject: Don't quit browser when get fatal js error. X-Git-Tag: v0.1.0~309 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=3c96007131aebdfbd8ffff9d24ed3d6a704d5424;p=electron.git Don't quit browser when get fatal js error. --- diff --git a/browser/atom/atom.js b/browser/atom/atom.js index ab74fd7b..94aa6489 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); +});