Bug 1121818 - Reject promise with instance of 'Error'. r=dimi
authorYoshi Huang <allstars.chh@mozilla.com>
Thu, 15 Jan 2015 12:17:46 +0800
changeset 224190 e0b32ca5a9672e282b777bf36460d68508f109d0
parent 224189 304f1c5f5af11593541a3d987880f3af4f598eb7
child 224191 47e905a0b0f5afaeb472b14e7659a7cd4b59e640
push id54150
push usercbook@mozilla.com
push dateFri, 16 Jan 2015 14:14:56 +0000
treeherdermozilla-inbound@ac6623427298 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdimi
bugs1121818
milestone38.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 1121818 - Reject promise with instance of 'Error'. r=dimi From da865c1cd62df020eba8515c3e19b962ccddd322 Mon Sep 17 00:00:00 2001 --- dom/nfc/nsNfc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dom/nfc/nsNfc.js
--- a/dom/nfc/nsNfc.js
+++ b/dom/nfc/nsNfc.js
@@ -85,17 +85,17 @@ NfcCallback.prototype = {
 
   notifyError: function notifyError(aErrorMsg) {
     let resolver = this.takePromiseResolver(atob(this._requestId));
     if (!resolver) {
       debug("can not find promise resolver for id: " + this._requestId +
            ", errormsg: " + aErrorMsg);
       return;
     }
-    resolver.reject(aErrorMsg);
+    resolver.reject(new this._window.Error(aErrorMsg));
   },
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
                                          Ci.nsIObserver,
                                          Ci.nsINfcRequestCallback]),
 };
 
 // Should be mapped to the NFCTagType defined in MozNFCTag.webidl.