Closed Bug 1148301 Opened 10 years ago Closed 10 years ago

FxAccounts.jsm throws promises as errors.

Categories

(Firefox :: Firefox Accounts, defect)

defect
Not set
normal
Points:
1

Tracking

()

RESOLVED INVALID

People

(Reporter: markh, Assigned: markh)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

I should have picked this up before, but:

  _error: function(aError, aDetails) {
...
    return Promise.reject(reason);
  },

and many things throw _error(...)

which means we are throwing a promise.  There's only 1 thing that actually returns the result or _error(), so the fix is:

* _error returns an error object.
* whoever wants to return a promise rejected with the error does "return Promise.reject(_error(...))

(the end result is that bug 1148273 works on 38 but fails on 39, as the code checking the error type is seeing the promise and not the error.)
Attachment #8584301 - Flags: review?(zack.carter)
Flags: qe-verify-
Flags: firefox-backlog+
Iteration: --- → 39.3 - 30 Mar
Blocks: 1132074
Comment on attachment 8584301 [details] [diff] [review]
0008-Bug-XXXXXXX-fix-error-handling-in-FxAccounts.jsm-to-.patch

Review of attachment 8584301 [details] [diff] [review]:
-----------------------------------------------------------------

This is fine, but could you also patch the new getSignedInUserProfile method that just landed?
Attachment #8584301 - Flags: review?(zack.carter) → review+
Sorry, I was confused.  This "bug" was caused by the "part 1" patch in bug 1139743 not being complete.  I've rolled the patch here into that bug and carried the r+ from this patch into that one.

> This is fine, but could you also patch the new getSignedInUserProfile method
> that just landed?

Yep, that's done in that patch.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Iteration: 39.3 - 30 Mar → ---
Product: Core → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: