8000 Specific error for stolen lock? · Issue #39 · w3c/web-locks · GitHub
[go: up one dir, main page]

Skip to content

Specific error for stolen lock? #39

@inexorabletash

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.

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

      0