Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report runtime error in shared workers #5363

Open
elkurin opened this issue Mar 17, 2020 · 3 comments
Open

Report runtime error in shared workers #5363

elkurin opened this issue Mar 17, 2020 · 3 comments

Comments

@elkurin
Copy link
Contributor

elkurin commented Mar 17, 2020

Shared workers now handle fetch/parse error but not runtime(evaluation) error.
This is because we catch fetch/parse error here:

Step 12: If the algorithm asynchronously completes with null or with a script whose error to rethrow is non-null, then:
Queue a task to fire an event named error at worker.
https://html.spec.whatwg.org/multipage/workers.html#worker-processing-model

On the other hand, unhandled runtime error is not caught.

For shared workers, if the error is still not handled afterwards, the error may be reported to a developer console.
https://html.spec.whatwg.org/#runtime-script-errors-2

This behavior is different from that of dedicated workers which fire an even name error at the associated workers if the event is not handled yet.

It might be better to fire an event for runtime error similarly to dedicated workers.
However, this might report to the shared worker instances which are not related to the evaluation error itself because one shared worker might be connected with several different instances and runtime error is invoked from only one of them.

This is also discussed in #5323.

@hiroshige-g
Copy link
Contributor

User-reported Chromium issue filed: https://bugs.chromium.org/p/chromium/issues/detail?id=1385619

@hiroshige-g
Copy link
Contributor

WPT Test: https://wpt.fyi/results/workers/SharedWorker-script-error.html?label=experimental&label=master&aligned

So Chrome/Safari follow the current spec while Firefox is (probably) aligned with the proposed behavior here.

@smaug----
Copy link

@ asutherland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants