Skip to content

Specific error for stolen lock? #39

Open

Description

@inexorabletash

Should there be a more specific error than an AbortError DOMException as the promise resolution when the lock is stolen? i.e.

try {
  const result = await navigator.locks.request('resource', async lock => {
     // ... hold for an arbitrary period, e.g. await new Promise(r => {})
  });
} catch (ex) {
  // anything more specific than ex.name === 'AbortError' here?
}

// elsewhere and elsewhen...
navigator.locks.request('resource', {steal: true}, lock => {});

ex.message will have more details for logging purposes, at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions