Bug 1004665 - If the crash reporter is disabled, .annotateCrashReport will throw an exception. Catch it and continue. r=gfritzsche, a=sledru
authorBenjamin Smedberg <benjamin@smedbergs.us>
Mon, 05 May 2014 10:31:26 -0400
changeset 199253 1606b7afe077cff2b7830bb7deb67df7aa642726
parent 199252 be4ae11bd65e139fc6d1f080e6c04f1b72f47fc5
child 199254 7f6a7121a73c09824cb6311830fe96d31e756d6e
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche, sledru
bugs1004665
milestone31.0a2
Bug 1004665 - If the crash reporter is disabled, .annotateCrashReport will throw an exception. Catch it and continue. r=gfritzsche, a=sledru
browser/experiments/Experiments.jsm
toolkit/content/aboutSupport.js
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -1158,17 +1158,21 @@ Experiments.Experiments.prototype = {
 
     gPrefs.set(PREF_ACTIVE_EXPERIMENT, activeExperiment != null);
 
     if (activeChanged) {
       Services.obs.notifyObservers(null, EXPERIMENTS_CHANGED_TOPIC, null);
     }
 
     if ("@mozilla.org/toolkit/crash-reporter;1" in Cc && activeExperiment) {
-      gCrashReporter.annotateCrashReport("ActiveExperiment", activeExperiment.id);
+      try {
+        gCrashReporter.annotateCrashReport("ActiveExperiment", activeExperiment.id);
+      } catch (e) {
+        // It's ok if crash reporting is disabled.
+      }
     }
   },
 
   /*
    * Schedule the soonest re-check of experiment applicability that is needed.
    */
   _scheduleNextRun: function () {
     this._checkForShutdown();
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -8,23 +8,27 @@ Cu.import("resource://gre/modules/XPCOMU
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/Troubleshoot.jsm");
 Cu.import("resource://gre/modules/ResetProfile.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 
 window.addEventListener("load", function onload(event) {
+  try {
   window.removeEventListener("load", onload, false);
   Troubleshoot.snapshot(function (snapshot) {
     for (let prop in snapshotFormatters)
       snapshotFormatters[prop](snapshot[prop]);
   });
   populateResetBox();
   setupEventListeners();
+  } catch (e) {
+    Cu.reportError("stack of load error for about:support: " + e + ": " + e.stack);
+  }
 }, false);
 
 // Each property in this object corresponds to a property in Troubleshoot.jsm's
 // snapshot data.  Each function is passed its property's corresponding data,
 // and it's the function's job to update the page with it.
 let snapshotFormatters = {
 
   application: function application(data) {