I think https://bugs.chromium.org/p/chromium/issues/detail?id=991544 is a related topic.
In the bug, we've been discussing that we should use ExceptionState::ThrowDOMException instead of the DOMException constructors. According to your demand, we may want to reverse the direction. We may want to move the stack-trace association from ExceptionState::ThrowDOMException into the DOMException constructors. Then, it should be naturally (re)usable by subclasses of DOMException. If we go in this direction, I think we first need the feasibility investigation. All instances of DOMException (and its subclasses) must be created in an appropriate v8::Context. Blink does not always enter in a v8::Context. We don't know whether we currently instantiate every DOMException in a v8::Context or not. I'm open to other options. Any comments are welcome. Cheers, Yuki Shiino 2021年8月23日(月) 17:45 Kentaro Hara <[email protected]>: > @Yuki Shiino <[email protected]> > > On Mon, Aug 23, 2021 at 5:22 PM Adam Rice <[email protected]> wrote: > >> I need to create a subclass of DOMException (WebTransportError >> <https://w3c.github.io/webtransport/#web-transport-error-interface>). I >> would like to make sure the stack is initialised correctly, but >> V8ThrowDOMException::CreateOrEmpty() >> <https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h;l=30?q=V8ThrowDOMException::CreateOrEmpty> >> is not reusable and looks really complicated. >> >> Is there a good solution? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "blink-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC_ixdxhHpxjAjqDgq%2BD7HNx3_ZixfYzUTCT215mdHiUJtZ17A%40mail.gmail.com >> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAC_ixdxhHpxjAjqDgq%2BD7HNx3_ZixfYzUTCT215mdHiUJtZ17A%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Kentaro Hara, Tokyo > -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAN0uC_TYiJ56cnEpZ6RSn-UhNFooormuDN-DRO9Kqz_rWqAmJA%40mail.gmail.com.
