Bug 1416295 - Support downloading updates from servers that don't support resuming.
MozReview-Commit-ID: Cw0cUibaD3d
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -3593,17 +3593,25 @@ class ChannelDownloader extends CommonDo
return;
}
LOG("ChannelDownloader:onStartRequest");
this._bkgFileSaver.onStartRequest(request, context);
if (request instanceof Ci.nsIResumableChannel) {
- this._patch.setProperty("entityID", request.entityID);
+ // Reading the entityID can throw if the server doesn't allow resuming.
+ try {
+ this._patch.setProperty("entityID", request.entityID);
+ } catch (ex) {
+ if (!(ex instanceof Components.Exception) ||
+ ex.result != Cr.NS_ERROR_NOT_RESUMABLE) {
+ throw ex;
+ }
+ }
}
var um = Cc["@mozilla.org/updates/update-manager;1"].
getService(Ci.nsIUpdateManager);
um.saveUpdates();
var listeners = this._listeners.concat();
var listenerCount = listeners.length;