From: Cheng Zhao Date: Mon, 5 May 2014 08:50:11 +0000 (+0800) Subject: Also report when user provided strange files. X-Git-Tag: v0.12.2~2^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0e7c7ca34b7ca2214efc3f3a8f9803ffbce9f4ca;p=electron.git Also report when user provided strange files. --- diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index b20e2f55..514268ea 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -17,19 +17,15 @@ if (argv._.length > 0) { try { require(path.resolve(argv._[0])); } catch(e) { - if (e.code == 'MODULE_NOT_FOUND') { - 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; - } + 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 if (argv.version) { console.log('v' + process.versions['atom-shell']);