Re: [whatwg/webidl] Allow DOMException subclasses to be used as exceptions (PR #1211)

@domenic commented on this pull request.



> +<div class=example id=example-exception-throwing-message-hint>
+    <p>An example of including additional information used to construct the [=exception/message=]
+    would be:
+
+    <blockquote>
+        [=exception/Throw=] a "{{SyntaxError}}" {{DOMException}} indicating that the given value
+        had disallowed trailing spaces.
+    </blockquote>
+
+    <p>Such additional context is most helpful to implementers when it is not immediately obvious
+    why the exception is being thrown, e.g., because there are many different steps in the algorithm
+    which throw "{{SyntaxError}}" {{DOMException}}s. In contrast, if your specification throws a
+    "{{NotAllowedError}}" {{DOMException}} immediately after checking if the user has provided
+    permission to use a given feature, it's fairly obvious what sort of [=exception/message=] the
+    implementation should construct, and so specifying it is not necessary.
+</div>

I think this is more about ensuring that the `message` value which implementers construct from the context given by the spec author, does not introduce tracking vectors. I'll add it over in that section; let me know what you think.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1211#discussion_r991162893
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/pull/1211/review/1135836137@github.com>

Received on Monday, 10 October 2022 11:02:42 UTC