-
Notifications
You must be signed in to change notification settings - Fork 39
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
Expose Wasm errors in stderr #131
Comments
Will love to work on this issue @Angelmmiguel |
That would be amazing @carrycooldude! I’m gonna assign the task to you just for tracking 😄. Feel free to drop any question you may have about the issue. |
Just need to ask @Angelmmiguel , I just have to add Error Msg right? |
Exactly @carrycooldude. The goal is to capture the error from the If that variable is present, you should write the data to that file descriptor. If it's not present, you can just print the error using I forgot to add that to the issue, so I also updated the description accordingly. |
Closed by #141 🎉 |
Is your feature request related to a problem? Please describe.
When processing a request in a worker, failures may happen at two different levels:
stderr
and continue processing the request or providing an error response.wws
returns the error (Wasm backtrace) to the handler.In the first case, we're already printing any data sent to
stderr
from the worker. After 5207684, we're inheriting thestderr
from the environment and configuring it in the WASI context. You can also configure thestderr
when usingwws
as a library.However, for the second case we're not printing any error and just providing a default error page:
wasm-workers-server/crates/server/src/handlers/worker.rs
Lines 72 to 79 in 5631fb4
This error exposes the Wasm backtrace. This information is very relevant for debugging on both development and production.
Describe the solution you'd like
Before sending a generic error,
wws
must print the Wasm backtrace in the terminal. Thestderr
is configurable, so thestderr_file
(Option<File>
) may contain a file descriptor that should be use. If it'sNone
, you can directly calleprintln!
with the proper message.There's a different task to improve how
wws
manages errors (#73)Describe alternatives you've considered
None
Additional context
The text was updated successfully, but these errors were encountered: