Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific error for stolen lock? #39

Open
inexorabletash opened this issue Mar 1, 2018 · 0 comments
Open

Specific error for stolen lock? #39

inexorabletash opened this issue Mar 1, 2018 · 0 comments
Labels
Milestone

Comments

@inexorabletash
Copy link
Member

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.

@inexorabletash inexorabletash added this to the v1 milestone May 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant