From ce4146f48d3bb3357b81697be4d81ef2c00a4421 Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Mon, 7 Apr 2014 10:33:56 -0400 Subject: [PATCH] Bug 992363 - Fix a few uncaught async errors in services. r=rnewman --- services/datareporting/policy.jsm | 4 ++-- services/sync/modules/browserid_identity.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/services/datareporting/policy.jsm b/services/datareporting/policy.jsm index 0551fc0f1f08..a95788c8cd3f 100644 --- a/services/datareporting/policy.jsm +++ b/services/datareporting/policy.jsm @@ -932,7 +932,7 @@ this.DataReportingPolicy.prototype = Object.freeze({ let deferred = Promise.defer(); - deferred.promise.then(onComplete, function onError(error) { + deferred.promise.then(onComplete, (error) => { this._log.warn("Data policy notification presentation failed: " + CommonUtils.exceptionStr(error)); }); @@ -1015,7 +1015,7 @@ this.DataReportingPolicy.prototype = Object.freeze({ let onError = function onError(error) { this._log.error("Error when handling data submission result: " + - CommonUtils.exceptionStr(result)); + CommonUtils.exceptionStr(error)); this._inProgressSubmissionRequest = null; this._handleSubmissionFailure(); }.bind(this); diff --git a/services/sync/modules/browserid_identity.js b/services/sync/modules/browserid_identity.js index c03c48ffd4eb..0489cd2b81a1 100644 --- a/services/sync/modules/browserid_identity.js +++ b/services/sync/modules/browserid_identity.js @@ -183,6 +183,10 @@ this.BrowserIDManager.prototype = { // Reset the world before we do anything async. this.whenReadyToAuthenticate = Promise.defer(); + this.whenReadyToAuthenticate.promise.then(null, (err) => { + this._log.error("Could not authenticate: " + err); + }); + this._shouldHaveSyncKeyBundle = false; this._authFailureReason = null;