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?
I guess reader.releaseLock(reason).
Anything else?
No response
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 callreader.releaseLock(), allowing for another reader to come along later.This rejects
reader.read()with aTypeError, 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?
I guess
reader.releaseLock(reason).Anything else?
No response