]> khamidou — GitHub mirrors - electron.git/commitdiff
Use dialog.showErrorBox for showing errors
authorCheng Zhao <zcbenz@gmail.com>
Wed, 5 Nov 2014 08:05:29 +0000 (16:05 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 5 Nov 2014 08:05:29 +0000 (16:05 +0800)
atom/browser/default_app/main.js
atom/browser/lib/init.coffee

index ae4a844cca38ad65d86b8902b531e5c425fa296b..d42fb2edc643df19087b669dbffd20b2909063ac 100644 (file)
@@ -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);
index ff8137f8efecda97d64526f0f395ebf6e2db2a63..ae2419b2199b0d7c490d9288cde47060f3d6ba46 100644 (file)
@@ -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', ->