1
0
Fork 0

Fixed a bug where it was not possible to get any error information from Foxx Apps being installed through the WebInterface.

This commit is contained in:
Michael Hackstein 2015-08-12 13:08:49 +02:00
parent c3c6220eeb
commit 36cd02065f
1 changed files with 7 additions and 3 deletions

View File

@ -11,18 +11,22 @@
}; };
var installCallback = function(result) { var installCallback = function(result) {
window.hass = result;
if (result.error === false) { if (result.error === false) {
this.collection.fetch({ async: false }); this.collection.fetch({ async: false });
window.modalView.hide(); window.modalView.hide();
this.reload(); this.reload();
} else { } else {
// TODO Error handling properly! var res = result;
switch(result.errorNum) { if (result.hasOwnProperty("responseJSON")) {
res = result.responseJSON;
}
switch(res.errorNum) {
case errors.ERROR_APPLICATION_DOWNLOAD_FAILED.code: case errors.ERROR_APPLICATION_DOWNLOAD_FAILED.code:
alert("Unable to download application from the given repository."); alert("Unable to download application from the given repository.");
break; break;
default: default:
alert("Error: " + result.errorNum + ". " + result.errorMessage); alert("Error: " + res.errorNum + ". " + res.errorMessage);
} }
} }
}; };