error

fun error(error: JsError = definedExternally)(source)

The error() method of the ReadableStreamDefaultController interface causes any future interactions with the associated stream to error.

MDN Reference