error

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

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

MDN Reference