From f6ba308ff88ed37d0f3a71484a2166f3d5077e64 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 5 Nov 2014 16:05:29 +0800 Subject: [PATCH] Use dialog.showErrorBox for showing errors --- atom/browser/default_app/main.js | 8 +------- atom/browser/lib/init.coffee | 10 +++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index ae4a844cca38..d42fb2edc643 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -49,13 +49,7 @@ if (option.file && !option.webdriver) { if (e.code == 'MODULE_NOT_FOUND') { app.focus(); console.error(e.stack); - dialog.showMessageBox({ - type: 'warning', - buttons: ['OK'], - title: 'Error opening app', - message: 'The app provided is not a valid atom-shell app, please read the docs on how to write one:', - detail: 'https://github.com/atom/atom-shell/tree/master/docs' - }); + dialog.showErrorBox('Error opening app', 'The app provided is not a valid atom-shell app, please read the docs on how to write one:\nhttps://github.com/atom/atom-shell/tree/master/docs'); process.exit(1); } else { console.error('App throwed an error when running', e); diff --git a/atom/browser/lib/init.coffee b/atom/browser/lib/init.coffee index ff8137f8efec..ae2419b2199b 100644 --- a/atom/browser/lib/init.coffee +++ b/atom/browser/lib/init.coffee @@ -45,13 +45,9 @@ process.once 'BIND_DONE', -> # Don't quit on fatal error. process.on 'uncaughtException', (error) -> # Show error in GUI. - message = error.stack ? "#{error.name}: #{error.message}" - require('dialog').showMessageBox - type: 'warning' - title: 'A javascript error occured in the browser' - message: 'uncaughtException' - detail: message - buttons: ['OK'] + stack = error.stack ? "#{error.name}: #{error.message}" + message = "Uncaught Exception:\n#{stack}" + require('dialog').showErrorBox 'A JavaScript error occured in the browser process', message # Emit 'exit' event on quit. require('app').on 'quit', ->