Intent to Ship: self.reportError()

168 views
Skip to first unread message

Domenic Denicola

unread,
Aug 27, 2021, 5:07:52 PM8/27/21
to blink-dev

Contact emails

dom...@chromium.org

Explainer

https://github.com/whatwg/console/issues/50, or perhaps the below summary, should suffice; this is a very small feature.

Specification

https://html.spec.whatwg.org/#dom-reporterror

Summary

This function, available in windows and workers, allows developers to report errors to the console and any global "error" event handlers, in the same way as an uncaught JavaScript exception. It is mainly useful for custom event-dispatching or callback-manipulating libraries.


Blink component

Blink>HTML>Script

TAG review

This is a minor exposure of browser functionality with a one-line spec. I'm happy to file for review if people think it would be helpful but I don't think there's much architecturally to discuss here.

TAG review status

Not applicable

Risks

Interoperability and Compatibility

Low. Mozilla was the one that originally proposed this in the spec PR, and has already shipped. It is likely pretty easy to implement for WebKit as it is just exposing existing functionality to JavaScript.



Gecko: Shipped/Shipping. They pass all the web platform tests on wpt.fyi

WebKit: No signal (https://lists.webkit.org/pipermail/webkit-dev/2021-August/031960.html)

Web developers: Positive (https://github.com/whatwg/html/pull/1196#issuecomment-854177687). A number of frameworks and libraries have mentioned that they would use this in the way it was designed, to better report exceptions in their custom callback dispatch code.

Activation

This feature is somewhat polyfillable using explicit self.dispatchEvent(new ErrorEvent(...)) plus console.error(), but it won't be quite first-class. In the meantime most developers have resorted to setTimeout(() => { throw e; }, 0) which loses stack trace information.



Debuggability

This feature doesn't need any extra DevTools support. It builds on the existing code that makes exception reporting work.


Is this feature fully tested by web-platform-tests?

Yes


Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1233383


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5634523220934656

This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Aug 30, 2021, 7:34:14 AM8/30/21
to Domenic Denicola, blink-dev
LGTM1

On Fri, Aug 27, 2021 at 11:07 PM 'Domenic Denicola' via blink-dev <blin...@chromium.org> wrote:

Contact emails

dom...@chromium.org

Explainer

https://github.com/whatwg/console/issues/50, or perhaps the below summary, should suffice; this is a very small feature.

Specification

https://html.spec.whatwg.org/#dom-reporterror

Summary

This function, available in windows and workers, allows developers to report errors to the console and any global "error" event handlers, in the same way as an uncaught JavaScript exception. It is mainly useful for custom event-dispatching or callback-manipulating libraries.


Blink component

Blink>HTML>Script

TAG review

This is a minor exposure of browser functionality with a one-line spec. I'm happy to file for review if people think it would be helpful but I don't think there's much architecturally to discuss here.

Agree that the mix of a small feature already landed in HTML with the fact that we're following Mozilla here means that no TAG review is required here.



TAG review status

Not applicable

Risks

Interoperability and Compatibility

Low. Mozilla was the one that originally proposed this in the spec PR, and has already shipped. It is likely pretty easy to implement for WebKit as it is just exposing existing functionality to JavaScript.



Gecko: Shipped/Shipping. They pass all the web platform tests on wpt.fyi

WebKit: No signal (https://lists.webkit.org/pipermail/webkit-dev/2021-August/031960.html)


Web developers: Positive (https://github.com/whatwg/html/pull/1196#issuecomment-854177687). A number of frameworks and libraries have mentioned that they would use this in the way it was designed, to better report exceptions in their custom callback dispatch code.

Activation

This feature is somewhat polyfillable using explicit self.dispatchEvent(new ErrorEvent(...)) plus console.error(), but it won't be quite first-class. In the meantime most developers have resorted to setTimeout(() => { throw e; }, 0) which loses stack trace information.



Debuggability

This feature doesn't need any extra DevTools support. It builds on the existing code that makes exception reporting work.


Is this feature fully tested by web-platform-tests?

Yes


Requires code in //chrome?

False

Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1233383


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5634523220934656

This intent message was generated by Chrome Platform Status.

--
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 blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAM0wra-L-Jqk5W2_XLU35t0LhKqnu0igYWJQSE20cqPxwmr3Zg%40mail.gmail.com.

Manuel Rego Casasnovas

unread,
Sep 1, 2021, 11:38:46 AM9/1/21
to Yoav Weiss, Domenic Denicola, blink-dev

Chris Harrelson

unread,
Sep 1, 2021, 11:48:50 AM9/1/21
to Manuel Rego Casasnovas, Yoav Weiss, Domenic Denicola, blink-dev
LGTM3

--
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 blink-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages