From eb0d8d46cc846148fafa461d424b8267a496fcb0 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 30 Jun 2016 14:30:39 -0400 Subject: [PATCH] minifix(GUI): handle image dialog and drive selector errors (#548) Currently, if either `OSDialogService.selectImage()` or `DriveSelectorService.open()` are rejected, we completely swallow the errors, making very hard to debug certain problems. This PR takes care of showing the usual error dialog for those cases. Change-Type: patch Signed-off-by: Juan Cruz Viotti --- lib/gui/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/gui/app.js b/lib/gui/app.js index 8da48ab4..fa2e36a6 100644 --- a/lib/gui/app.js +++ b/lib/gui/app.js @@ -210,7 +210,7 @@ app.controller('AppController', function( } this.selectImage(image); - }); + }).catch(this.handleError); }; this.selectDrive = (drive) => { @@ -222,7 +222,9 @@ app.controller('AppController', function( }; this.openDriveSelector = () => { - DriveSelectorService.open().then(this.selectDrive); + DriveSelectorService.open() + .then(this.selectDrive) + .catch(this.handleError); }; this.reselectImage = () => {