Closed Bug 1735663 Opened 3 years ago Closed 3 years ago

Audit Error Messages, and make sure they're on par with JS Streams implementation

Categories

(Core :: DOM: Streams, task)

task

Tracking

()

RESOLVED FIXED

People

(Reporter: mgaudet, Assigned: evilpie)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

We need to audit our Error messages and make sure that they're approximately on par with the JS Streams implementation.

(Mildly concerned we need to make sure we match them for compat reasons, but, 🤞🏻)

We definitely need to make some improvements to our error messages. We are worse than our old implementation and Chrome.

As an example:

new ReadableStream({ start(controller) { controller.close(); controller.close() } })
Firefox old: 'close' called on a stream already closing.
Chrome: Failed to execute 'close' on 'ReadableStreamDefaultController': Cannot close a readable stream that has already been requested to be closed
Firefox new: ReadableStreamDefaultController.close: Cannot Close

var stream = new ReadableStream(); stream.getReader(); new ReadableStreamDefaultReader(stream);
Firefox old: n/a (no ReadableStreamDefaultReader)
Chrome: Failed to construct 'ReadableStreamDefaultReader': ReadableStreamDefaultReader constructor can only accept readable streams that are not yet locked to a reader
Firefox new: ReadableStreamDefaultReader constructor: Stream is Locked

Keywords: leave-open
Assignee: nobody → evilpies
Status: NEW → ASSIGNED
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/765503830af8 Improve ReadableStream.cancel error message. r=mgaudet
Assignee: evilpies → nobody
Status: ASSIGNED → NEW
Assignee: nobody → evilpies
Status: NEW → ASSIGNED
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/e26bf5b90433 Improve error messages for ReadableStreamDefaultController. r=mgaudet
Regressions: 1749852
No longer regressions: 1749852
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/autoland/rev/cc74f768d0eb Improve error messages for ReadableStream reader. r=mgaudet

All readable streams (excluding byte streams) error messages should now be in a good place. We can open a new bug for code we don't plan on shipping first.

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: