Skip to content

Allow error to be provided to reader.releaseLock() #1358

@jakearchibald

Description

@jakearchibald

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalNew features or enhancementsneeds implementer interestMoving the issue forward requires implementers to express interest

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions