From 36cd02065f73fbe12a3f08677ff7621ea3789767 Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Wed, 12 Aug 2015 13:08:49 +0200 Subject: [PATCH] Fixed a bug where it was not possible to get any error information from Foxx Apps being installed through the WebInterface. --- .../aardvark/APP/frontend/js/views/foxxInstallView.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/apps/system/_admin/aardvark/APP/frontend/js/views/foxxInstallView.js b/js/apps/system/_admin/aardvark/APP/frontend/js/views/foxxInstallView.js index e35ee9cce6..aefe677a2b 100644 --- a/js/apps/system/_admin/aardvark/APP/frontend/js/views/foxxInstallView.js +++ b/js/apps/system/_admin/aardvark/APP/frontend/js/views/foxxInstallView.js @@ -11,18 +11,22 @@ }; var installCallback = function(result) { + window.hass = result; if (result.error === false) { this.collection.fetch({ async: false }); window.modalView.hide(); this.reload(); } else { - // TODO Error handling properly! - switch(result.errorNum) { + var res = result; + if (result.hasOwnProperty("responseJSON")) { + res = result.responseJSON; + } + switch(res.errorNum) { case errors.ERROR_APPLICATION_DOWNLOAD_FAILED.code: alert("Unable to download application from the given repository."); break; default: - alert("Error: " + result.errorNum + ". " + result.errorMessage); + alert("Error: " + res.errorNum + ". " + res.errorMessage); } } };