workerd
workerd copied to clipboard
Implements the web platform standard reportError API
Refs: https://developer.mozilla.org/en-US/docs/Web/API/reportError
/cc @irvinebroque
If I call reportError
— what happens here with Tail Workers? Will the error will show up in the exceptions
field or the logs
field?
https://github.com/wintercg/proposal-common-minimum-api/issues/41 https://github.com/nodejs/node/issues/38947
... what happens here with Tail Workers?
I think that still needs to be determined. The reporting is the same as the existing logUncaughtException(...)
but I don't believe that ends up directly in the tail worker's exceptions
field. That'll be something we want to determine, I think.
Yeah we should figure out before merging any change, since would be weird if this ended up showing as logs. @zebp and @maxwellpeterson may know and can point to internal tail worker code
@irvinebroque ... ok, the PR has been updated to publish the reported error to the worker tracer as an exception. Unfortunately we can't actually have a test to verify it in workerd since workerd does not initialize the worker tracer at all. Manually verified in an internal test, however, that the reported error does, in fact, show up in the worker tracer as an exception, so I think we're good on that front.