Use dialog.showErrorBox for showing errors

This commit is contained in:
Cheng Zhao 2014-11-05 16:05:29 +08:00
parent 10e195a444
commit f6ba308ff8
2 changed files with 4 additions and 14 deletions

View file

@ -49,13 +49,7 @@ if (option.file && !option.webdriver) {
if (e.code == 'MODULE_NOT_FOUND') { if (e.code == 'MODULE_NOT_FOUND') {
app.focus(); app.focus();
console.error(e.stack); console.error(e.stack);
dialog.showMessageBox({ 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');
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'
});
process.exit(1); process.exit(1);
} else { } else {
console.error('App throwed an error when running', e); console.error('App throwed an error when running', e);

View file

@ -45,13 +45,9 @@ process.once 'BIND_DONE', ->
# Don't quit on fatal error. # Don't quit on fatal error.
process.on 'uncaughtException', (error) -> process.on 'uncaughtException', (error) ->
# Show error in GUI. # Show error in GUI.
message = error.stack ? "#{error.name}: #{error.message}" stack = error.stack ? "#{error.name}: #{error.message}"
require('dialog').showMessageBox message = "Uncaught Exception:\n#{stack}"
type: 'warning' require('dialog').showErrorBox 'A JavaScript error occured in the browser process', message
title: 'A javascript error occured in the browser'
message: 'uncaughtException'
detail: message
buttons: ['OK']
# Emit 'exit' event on quit. # Emit 'exit' event on quit.
require('app').on 'quit', -> require('app').on 'quit', ->