Only report "app invalid" error when app could not be loaded, fixes #294.
This commit is contained in:
parent
e415c66f68
commit
cfeb00e629
1 changed files with 14 additions and 9 deletions
|
@ -17,6 +17,7 @@ if (argv._.length > 0) {
|
||||||
try {
|
try {
|
||||||
require(path.resolve(argv._[0]));
|
require(path.resolve(argv._[0]));
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
if (e.code == 'MODULE_NOT_FOUND') {
|
||||||
app.focus();
|
app.focus();
|
||||||
dialog.showMessageBox({
|
dialog.showMessageBox({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
@ -26,6 +27,10 @@ if (argv._.length > 0) {
|
||||||
detail: 'https://github.com/atom/atom-shell/tree/master/docs'
|
detail: 'https://github.com/atom/atom-shell/tree/master/docs'
|
||||||
});
|
});
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
} else {
|
||||||
|
console.error('App throwed an error when running', e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (argv.version) {
|
} else if (argv.version) {
|
||||||
console.log('v' + process.versions['atom-shell']);
|
console.log('v' + process.versions['atom-shell']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue