- From: Domenic Denicola <notifications@github.com>
- Date: Thu, 27 Oct 2022 22:12:28 -0700
- To: whatwg/webidl <webidl@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/webidl/pull/1211/review/1159456423@github.com>
@domenic commented on this pull request.
> -
-There are two kinds of exceptions available to be thrown from specifications.
-The first is a <dfn id="dfn-simple-exception" export>simple exception</dfn>, which
-is identified by one of the following types:
+An <dfn id="dfn-exception" export>exception</dfn> is a type of object that represents an error and
+which can be thrown or treated as a first class value by implementations. Web IDL has a number of
+pre-defined exceptions that specifications can reference and throw in their definition of
+operations, attributes, and so on. Custom exception types can also be defined, as [=interfaces=]
+that [=interface/inherit=] from {{DOMException}}.
+
+In addition to their type, which is either one of the [=simple exceptions=], {{DOMException}}, or a
+derived interface of {{DOMException}}, all exceptions have a
+<dfn id="dfn-exception-message" for="exception" export>message</dfn>, which is an
+[=implementation-defined=] [=string=] that provides human readable details of the error.
+{{DOMException}} instances also have an
+<dfn id="dfn-exception-error-name" for="exception" export>error name</dfn> [=string=], which
The distinction is that these are defining the general concepts/types, and the DOMExceptions definitions are fields.
I think we could eliminate "error name", especially since in this PR I narrow it down to be DOMException-specific. I'll try that.
Eliminating "message" is a bit harder since it applies to all exceptions, not just DOMException. But I think it's doable.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/pull/1211#discussion_r1007631182
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/webidl/pull/1211/review/1159456423@github.com>
Received on Friday, 28 October 2022 05:12:44 UTC