Skip to content

Commit

Permalink
Add RaisesException to all methods in usb_device.idl
Browse files Browse the repository at this point in the history
This change rewrites all the functions in the WebUSB API's USBDevice
interface to use the ExceptionState class to generate exceptions that
cause these methods to return a rejected Promise synchronously.

Creating exceptions with the ExceptionState interface generates better
diagnostic messages than constructing a DOMException manually. The logic
has also been rewritten to use less nesting of conditionals for better
readability.

This is the second in a series of changes to use ExceptionState in this
interface. The final change will update how Promises are rejected
asynchronously.

Change-Id: Id2a6a722c8fa20c23c43854ad30f707f1901c807
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3632666
Reviewed-by: Jack Hsieh <chengweih@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001181}
  • Loading branch information
reillyeon authored and Chromium LUCI CQ committed May 9, 2022
1 parent 836085b commit 652a4ae
Show file tree
Hide file tree
Showing 3 changed files with 399 additions and 322 deletions.

0 comments on commit 652a4ae

Please sign in to comment.