-
Notifications
You must be signed in to change notification settings - Fork 251
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Web Worker error notifying #172
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. |
I think it would be very reliant on how #170 turns out. |
Does #170 solve the stacktrace problem, or is more required? |
More is required, as the error needs to be caught from within the worker in order to extract the stacktrace. If you'd like I can combine this into #170? |
As with #170, we are going to pick this up in the next major. |
It appears that a major release has come and gone since that last ^ comment. Is this still planned? |
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: worker.onerror = function(errorEvent) {
const bugsnagReport = new bugsnagClient.BugsnagReport(
"worker.onerror",
errorEvent.message,
[
{
fileName: errorEvent.filename,
lineNumber: errorEvent.lineno,
columnNumber: errorEvent.colno
}
],
{
severity: "error",
unhandled: true,
severityReason: { type: "unhandledException" }
}
);
bugsnagClient.notify(bugsnagReport);
}; Since the |
Hi all, just writing to let you know that we recently released support for Web Workers in bugsnag-js: You can read more about this in our docs: |
Right now you can technically catch errors from
Worker
s by listening to it'sonerror
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?
The text was updated successfully, but these errors were encountered: