Closed
Description
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
}