Bug 995353 - fix Firefox Accounts error propagation from toolkit/ through dom/ to web content. r=jedp
authorSam Penrose <spenrose@mozilla.com>
Wed, 23 Apr 2014 15:45:06 -0700
changeset 179886 38be37271c25398ee5bf1753d2bb334aaada90e9
parent 179885 1d7b9a01b8cf2759e071e2b120dc588aafc5f34a
child 179887 91946180b1e7a32cc6d86383b4db7a4a505cd2e7
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjedp
bugs995353
milestone31.0a1
Bug 995353 - fix Firefox Accounts error propagation from toolkit/ through dom/ to web content. r=jedp
dom/identity/nsDOMIdentity.js
toolkit/identity/FirefoxAccounts.jsm
--- a/dom/identity/nsDOMIdentity.js
+++ b/dom/identity/nsDOMIdentity.js
@@ -518,17 +518,17 @@ nsDOMIdentity.prototype = {
         break;
       case "Identity:RP:Watch:OnError":
         if (!this._rpWatcher) {
           this._log("WARNING: Received OnError message, but there is no RP watcher");
           return;
         }
 
         if (this._rpWatcher.onerror) {
-          this._rpWatcher.onerror(msg.message);
+          this._rpWatcher.onerror(JSON.stringify({name: msg.message.error}));
         }
         break;
       case "Identity:IDP:CallBeginProvisioningCallback":
         this._callBeginProvisioningCallback(msg);
         break;
       case "Identity:IDP:CallGenKeyPairCallback":
         this._callGenKeyPairCallback(msg);
         break;
--- a/toolkit/identity/FirefoxAccounts.jsm
+++ b/toolkit/identity/FirefoxAccounts.jsm
@@ -99,17 +99,17 @@ FxAccountsService.prototype = {
               this.doLogin(aRpCaller.id, data);
             } else {
               this.doLogout(aRpCaller.id);
             }
             this.doReady(aRpCaller.id);
           },
           error => {
             log.error("get silent assertion failed: " + JSON.stringify(error));
-            this.doError(aRpCaller.id, error.toString());
+            this.doError(aRpCaller.id, error);
           }
         );
       }
     };
     Services.tm.currentThread.dispatch(runnable,
                                        Ci.nsIThread.DISPATCH_NORMAL);
   },