Bug 802454 - Log messages for 404 errors when checking for add-on updates should include the URL. r=Unfocused
authorQuentin Headen <qheaden@phaseshiftsoftware.com>
Mon, 01 Apr 2013 22:15:40 +1300
changeset 126785 1c0e964bd620df1de9f09be8d4aa5a12f036a07b
parent 126784 b6e09da562989c871ae448956c9b69e8d2c1f1cf
child 126786 7bbe0b582f70fdf90afa8b5785d91baa0cda7e71
push id24494
push userryanvm@gmail.com
push dateMon, 01 Apr 2013 16:55:22 +0000
treeherdermozilla-central@7bbe0b582f70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersUnfocused
bugs802454
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 802454 - Log messages for 404 errors when checking for add-on updates should include the URL. r=Unfocused
toolkit/mozapps/extensions/AddonUpdateChecker.jsm
--- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
+++ b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm
@@ -387,33 +387,34 @@ function parseRDFManifest(aId, aUpdateKe
  *         The URL of the update manifest
  * @param  aObserver
  *         An observer to pass results to
  */
 function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
   this.id = aId;
   this.updateKey = aUpdateKey;
   this.observer = aObserver;
+  this.url = aUrl;
 
   this.timer = Cc["@mozilla.org/timer;1"].
                createInstance(Ci.nsITimer);
   this.timer.initWithCallback(this, TIMEOUT, Ci.nsITimer.TYPE_ONE_SHOT);
 
   let requireBuiltIn = true;
   try {
     requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS);
   }
   catch (e) {
   }
 
   LOG("Requesting " + aUrl);
   try {
     this.request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
                    createInstance(Ci.nsIXMLHttpRequest);
-    this.request.open("GET", aUrl, true);
+    this.request.open("GET", this.url, true);
     this.request.channel.notificationCallbacks = new CertUtils.BadCertHandler(!requireBuiltIn);
     this.request.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
     this.request.overrideMimeType("text/xml");
     var self = this;
     this.request.addEventListener("load", function loadEventListener(event) { self.onLoad() }, false);
     this.request.addEventListener("error", function errorEventListener(event) { self.onError() }, false);
     this.request.send(null);
   }
@@ -423,16 +424,17 @@ function UpdateParser(aId, aUpdateKey, a
 }
 
 UpdateParser.prototype = {
   id: null,
   updateKey: null,
   observer: null,
   request: null,
   timer: null,
+  url: null,
 
   /**
    * Called when the manifest has been successfully loaded.
    */
   onLoad: function UP_onLoad() {
     this.timer.cancel();
     this.timer = null;
     let request = this.request;
@@ -449,24 +451,25 @@ UpdateParser.prototype = {
       CertUtils.checkCert(request.channel, !requireBuiltIn);
     }
     catch (e) {
       this.notifyError(AddonUpdateChecker.ERROR_DOWNLOAD_ERROR);
       return;
     }
 
     if (!Components.isSuccessCode(request.status)) {
-      WARN("Request failed: " + request.status);
+      WARN("Request failed: " + this.url + " - " + request.status);
       this.notifyError(AddonUpdateChecker.ERROR_DOWNLOAD_ERROR);
       return;
     }
 
     let channel = request.channel;
     if (channel instanceof Ci.nsIHttpChannel && !channel.requestSucceeded) {
-      WARN("Request failed: " + channel.responseStatus + ": " + channel.responseStatusText);
+      WARN("Request failed: " + this.url + " - " + channel.responseStatus +
+           ": " + channel.responseStatusText);
       this.notifyError(AddonUpdateChecker.ERROR_DOWNLOAD_ERROR);
       return;
     }
 
     let xml = request.responseXML;
     if (!xml || xml.documentElement.namespaceURI == XMLURI_PARSE_ERROR) {
       WARN("Update manifest was not valid XML");
       this.notifyError(AddonUpdateChecker.ERROR_PARSE_ERROR);
@@ -497,22 +500,23 @@ UpdateParser.prototype = {
   /**
    * Called when the manifest failed to load.
    */
   onError: function UP_onError() {
     this.timer.cancel();
     this.timer = null;
 
     if (!Components.isSuccessCode(this.request.status)) {
-      WARN("Request failed: " + this.request.status);
+      WARN("Request failed: " + this.url + " - " + this.request.status);
     }
     else if (this.request.channel instanceof Ci.nsIHttpChannel) {
       try {
         if (this.request.channel.requestSucceeded) {
-          WARN("Request failed: " + this.request.channel.responseStatus + ": " +
+          WARN("Request failed: " + this.url + " - " +
+               this.request.channel.responseStatus + ": " +
                this.request.channel.responseStatusText);
         }
       }
       catch (e) {
         WARN("HTTP Request failed for an unknown reason");
       }
     }
     else {