[whatwg/streams] Allow error to be provided to reader.releaseLock() (Issue #1358)

jakearchibald created an issue (whatwg/streams#1358)

### What problem are you trying to solve?

I have a pending `reader.read()`, but at some point I'm no longer interested in the result, so I call `reader.releaseLock()`, allowing for another reader to come along later.

This rejects `reader.read()` with a `TypeError`, which is indistinguishable from other kinds of 'worse' errors.

I'd rather it rejected with something like an `AbortError`, as failure is expected in this case.

### What solutions exist today?

I guess setting some boolean when I call `releaseLock()`, so I know to ignore the error, then just hope the error wasn't relating to something else.

### How would you solve it?

_No response_

### Anything else?

_No response_

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1358
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1358@github.com>

Received on Tuesday, 7 October 2025 11:06:23 UTC