Skip to content

Non readable stream should throw when errored while not readable #39756

Closed
mdn/content
#13581
@ronag

Description

@ronag

https://developer.mozilla.org/en-US/docs/Web/API/ReadableStreamDefaultController/error#exceptions

TypeError
The source object is not a ReadableStreamDefaultController, or the stream is not readable for some other reason.

const { ReadableStream } = require('stream/web')

let c
const s = new ReadableStream({
  start (controller) {
    c = controller
  }
})

c.close()

try {
  c.error()
} catch (err) {
  console.error(err) // This should log an error
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions