Merge pull request #150 from resin-io/refactor/unify-elevation-error-handling

Unify handling of elevation errors in etcher.js
This commit is contained in:
Juan Cruz Viotti 2016-02-08 14:39:43 -04:00
commit efb2c4c911
2 changed files with 4 additions and 5 deletions

View File

@ -42,8 +42,7 @@ exports.require = function(app, callback) {
sudoPrompt.setName('Etcher');
sudoPrompt.exec(process.argv.join(' '), function(error) {
if (error) {
electron.dialog.showErrorBox('Elevation Error', error.message);
process.exit(1);
return callback(error);
}
// Don't keep the original parent process alive
@ -54,8 +53,7 @@ exports.require = function(app, callback) {
elevator.execute(process.argv, {}, function(error) {
if (error) {
electron.dialog.showErrorBox('Elevation Error', error.message);
process.exit(1);
return callback(error);
}
// Don't keep the original parent process alive

View File

@ -31,7 +31,8 @@ electron.app.on('ready', function() {
elevate.require(electron.app, function(error) {
if (error) {
throw error;
electron.dialog.showErrorBox('Elevation Error', error.message);
process.exit(1);
}
mainWindow = new electron.BrowserWindow({