From: Cheng Zhao Date: Mon, 5 May 2014 08:35:06 +0000 (+0800) Subject: Use dialog to report invalid app. X-Git-Tag: v0.12.2~2^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=c6448d0607f8c131221687d866cb9b2ca57153d9;p=electron.git Use dialog to report invalid app. --- diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index b3e3bcb0..b20e2f55 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -1,4 +1,5 @@ var app = require('app'); +var dialog = require('dialog'); var path = require('path'); var optimist = require('optimist'); @@ -17,8 +18,14 @@ if (argv._.length > 0) { require(path.resolve(argv._[0])); } catch(e) { if (e.code == 'MODULE_NOT_FOUND') { - console.error(e.stack); - console.error('Specified app is invalid'); + app.focus(); + 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' + }); process.exit(1); } else { throw e;