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);
# 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', ->