-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Error stack in worker missing #4728
Comments
@nayeemrmn could you look into this issue? It would require to serialize the error in Rust, forward it to JS (worker host) and then properly reconstruct it |
Based on browser behaviour, the worker should print errors to the terminal on its own. The parent worker is only made aware of the error if the user sets an error event listener on the worker object. I'll see what I can do. |
@nayeemrmn I think that's what happenning right now - if there's no error listener in the host then error is rethrown in host context. Thanks for looking into this 🙏 |
Okay, I think uncaught errors in Workers should print to the terminal themselves, and as a Deno-specific extension to satisfy our design goal, the main worker should terminate upon polling an unhandled error event like it does now. Since the Worker error would be printed above it, the error thrown by the main worker can stay vague.
|
@nayeemrmn I think that's not entirely correct - according to spec if there's no error handler attached to |
It seems the event should travel upwards, but I'm saying only the source Worker where the error occurred needs to be responsible for printing the genuine error stack (if it doesn't have a handler itself). I'm proposing that if the source worker has its own error handler which prevents default, nothing is printed. If it doesn't, it prints the error stack to stdout and propagates an event error upwards. If the event error reaches the main worker without being handled, we would just let it error out in |
Currently, every error thrown in worker has no trusted stacks, but only
The text was updated successfully, but these errors were encountered: