Web Worker error notifying
See original GitHub issueRight now you can technically catch errors from Worker
s by listening to it’s onerror
event. However it seems (at a first glance) that the stacktrace is lost. It might be worth having an additional (tiny) script to import within a worker which basically proxies the error & stacktrace back to the main thread for it to notify (making the worker completely config-less).
I still have to see what’s technically possible, but I’m pretty confident it can be done.
Thoughts?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to handle errors in HTML5 Web Workers? - Tutorialspoint
Debugging the errors ; message − it is only notified that there is an error ; lineon − notifies the number of the...
Read more >Worker: error event - Web APIs - MDN Web Docs
The error event of the Worker interface fires when an error occurs in the worker. Syntax. Use the event name in methods like...
Read more >Create notification by webworker - javascript - Stack Overflow
problem is when some error takes place worker can't notify about that in console like code in main thread does. Thanks for trick,...
Read more >Web Push Troubleshooting - OneSignal Documentation
There is a common error thrown when trying to connect with the OneSignal Service Worker files. More details on how to fix this...
Read more >Where to send the email to notify an error in a worker?
One option is in the worker, in the catch, after log the error, but perhaps it is much work than the worker should...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the report, @jacobmarshall. Seems like kinda of a hairy issue, but I’m open to ideas. 🤔 @eanakashima @wordofchristian might also have some thoughts.
For anyone here who saw @jmshal’s statement
and is wondering how to actually do that, I dug through the code for a while and eventually came up with this:
Since the
ErrorEvent
interface is used for every error event except forwindow.onerror
, I wonder if it makes sense to allowBugsnag.notify
to take anErrorEvent
and just change Bugsnag’swindow.onerror
(which does not pass anErrorEvent
—see MDN doc) towindow.addEventListener("error", ...)
(which does). Thoughts?