From c57692c258b371f8094c57d20dd568a2083fab9a Mon Sep 17 00:00:00 2001 From: Martyn Haigh Date: Fri, 24 Jan 2014 21:02:27 -0800 Subject: [PATCH] bug 957062 - Pass APK download error back to webpage; r=wesj --HG-- extra : rebase_source : 6428fc64176d1e0e31ebd5026fdb51e781ac4937 --- mobile/android/modules/WebappManager.jsm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mobile/android/modules/WebappManager.jsm b/mobile/android/modules/WebappManager.jsm index 2831007cbed9..238b0fa755ca 100644 --- a/mobile/android/modules/WebappManager.jsm +++ b/mobile/android/modules/WebappManager.jsm @@ -43,7 +43,7 @@ this.WebappManager = { return; } - this._downloadApk(aMessage); + this._downloadApk(aMessage, aMessageManager); }, installPackage: function(aMessage, aMessageManager) { @@ -53,10 +53,10 @@ this.WebappManager = { return; } - this._downloadApk(aMessage); + this._downloadApk(aMessage, aMessageManager); }, - _downloadApk: function(aMsg) { + _downloadApk: function(aMsg, aMessageManager) { let manifestUrl = aMsg.app.manifestURL; dump("_downloadApk for " + manifestUrl); @@ -94,7 +94,8 @@ this.WebappManager = { data: JSON.stringify(aMsg), }); } else { // type == "failure" - // TODO: handle error better. + aMsg.error = message; + aMessageManager.sendAsyncMessage("Webapps:Install:Return:KO", aMsg); dump("error downloading APK: " + message); } }