Skip to content

Commit

Permalink
Use ExceptionContext to reject Promises in blink::USBDevice
Browse files Browse the repository at this point in the history
This change rewrites all of the asynchronous Promise rejection in the
USBDevice interface to use the new RejectWithDOMException() and
RejectWithSecurityError() methods added to ScriptPromiseResolver so that
the DOMExceptions are created using the ExceptionContext from the
original call from JavaScript.

This will generate better exception messages than creating DOMExceptions
with the constructor.

This is the final patch in this series updating the USBDevice interface.

Change-Id: Ib77509d37a1c2a3111cac2a11d00773b6d22731d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3633248
Reviewed-by: Michael Wilson <mjwilson@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001270}
  • Loading branch information
reillyeon authored and Chromium LUCI CQ committed May 10, 2022
1 parent 0d6fd0f commit 529ac00
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 153 deletions.

0 comments on commit 529ac00

Please sign in to comment.