abort

suspend fun abort(reason: JsError? = definedExternally)(source)

The abort() method of the WritableStream interface aborts the stream, signaling that the producer can no longer successfully write to the stream and it is to be immediately moved to an error state, with any queued writes discarded.

MDN Reference