Report errors from worklet scripts to console
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
People
(Reporter: karlt, Assigned: karlt)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
WorkerErrorReport::AssignErrorReport() and WorkerErrorReport members look useful for worklets. WorkerErrorNote is only used in this class.
Its LogErrorToConsole methods look suitable for worklets too, with some adjustment for category and kErrorString[].
There is no worklet execution thread event to dispatch for worklets.
If js::ErrorReport::init() returns true, then report() will be non-null.
WarningOnlyErrorReporter() assumes aRep is non-null.
=> aReport is always non-null in WorkerPrivate::ReportError().
=> aToStringResult handling can be moved to WorkerErrorReport::AssignErrorReport().
The stack handling of WorkerPrivate::ReportError() would also be common to worklets.
Assignee | ||
Comment 1•5 years ago
|
||
For the main thread, AutoJSAPI uses xpc::ErrorReport to create and dispatch nsIScriptErrors to nsIConsoleService.
Workers use WorkerErrorReport in response to exceptions and warnings caught by AutoJSAPI to dispatch ErrorEvents and to create and log nsIScriptErrors to nsIConsoleService.
xpc::ErrorReport is also used for errors during worker script loading, and, on main and other threads, to report rejected promises.
WorkerErrorReport has some other worker-specific bits, including mExnType, mErrorNumber, worker parent chains, and logging of messages from ErrorData.
WorkerErrorReport does not set nsIScriptError::errorMessageName, nor nsIScriptError::sourceId.
I'll use xpc::ErrorReport here because that is the existing generic class for dispatching nsIScriptErrors to nsIConsoleService from C++.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
There is no ErrorEvent dispatched to WorkletGlobalScope.
See also https://github.com/whatwg/html/issues/2611
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D44600
Assignee | ||
Comment 4•5 years ago
|
||
https://drafts.css-houdini.org/worklets/#fetch-and-invoke-a-worklet-script
requires that the addModule() promise is rejected with an "AbortError"
DOMException. https://github.com/w3c/css-houdini-drafts/issues/509 proposes a
more specific error, but that has not been implemented in another browser.
StealExceptionFromJSContext() set ErrorCode to
NS_ERROR_INTERNAL_ERRORRESULT_JS_EXCEPTION if there was a pending exception
(or NS_ERROR_OUT_OF_MEMORY on failure to record the JS exception) or
NS_ERROR_UNCATCHABLE_EXCEPTION if there was no pending exception.
StealNSResult() converted NS_ERROR_INTERNAL_ERRORRESULT_JS_EXCEPTION to
NS_ERROR_DOM_INVALID_STATE_ERR.
Information about the error is lost on conversion of a SyntaxError to the
promise rejection, so allow the SyntaxError to be reported the console.
Depends on D44601
Assignee | ||
Comment 5•5 years ago
|
||
https://phabricator.services.mozilla.com/D44612 proposes more tests for these changes.
Comment 7•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1069ae045160
https://hg.mozilla.org/mozilla-central/rev/13ff86cb281e
https://hg.mozilla.org/mozilla-central/rev/509d3ab24880
Comment 8•5 years ago
|
||
Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•5 years ago
|
Description
•