Skip to content

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

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

    Labels

    web streamsIssues and PRs related to the Web Streams API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions