Closed Bug 1603126 Opened 2 years ago Closed 2 years ago

Properly reject in async-storage.js

Categories

(DevTools :: Shared Components, task, P3)

task

Tracking

(firefox73 fixed)

RESOLVED FIXED
Firefox 73
Tracking Status
firefox73 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

In this file, reject is often called with 2 arguments:

reject("Error while doing X:", req.error.name);

(See devtools/shared/async-storage.js#92)

But reject only take a single argument, which means that catching those rejection would only give access to the error "message", while omitting the error name.

We can probably reject either an object with the message + the exception.

All the rejections were called with 2 arguments, when reject only
cares about the first one.
This patch makes all the reject called with the actual DOMException,
and adds console.error before all those rejections.

Depends on D56744

Assignee: nobody → nchevobbe
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/262025967f52
Fix Promise rejections in async-storage. r=jdescottes.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73
You need to log in before you can comment on or make changes to this bug.