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

We need a better way to handle node.js + pthreads errors #9899

Open
VirtualTim opened this issue Nov 26, 2019 · 5 comments
Open

We need a better way to handle node.js + pthreads errors #9899

VirtualTim opened this issue Nov 26, 2019 · 5 comments
Labels

Comments

@VirtualTim
Copy link
Collaborator

With the changes made in #9863 errors in a node.js pthread are reported like pthread sent an error! undefined:undefined: Module is not a function.
This could be more helpful, it would be good to get a line number and file like we do in the web case. At a minimum undefined:undefined should go.

My suggestion would be to replace

worker.onerror(data);

with err('pthread sent an error!\n' + data.stack);. This will print out something like:

pthread sent an error!
TypeError: Module is not a function
    at onmessage (/path/module.worker.js:93:16)
    [stacktrace continues]

This is slightly more helpful. However I'm not familiar enough with node to know if there's something better.
Anyone have any better ideas?

@kripken
Copy link
Member

kripken commented Nov 26, 2019

cc @addaleax

@addaleax
Copy link

This is slightly more helpful. However I'm not familiar enough with node to know if there's something better.

This is what I would do too 👍 If you do want an alternative, it would be require('util').inspect(data), which generally aims to provide the most debugging-friendly representation of an object (it’s what Node uses for console.log()).

@stale
Copy link

stale bot commented Nov 26, 2020

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Nov 26, 2020
@sbc100
Copy link
Collaborator

sbc100 commented Nov 26, 2020

This is still an issue. I just ran into what I think is the same thing in #12885. I think #11345 boils down to basically the same thing so we should probably merge them.

Is this really node only issue? Its seems to happen on the web as well?

@stale stale bot removed the wontfix label Nov 26, 2020
@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants