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
DAP server: Improved handling of Rust panic
in the API.
#1668
Comments
As an experiment I implemented first
Coincidentally, the work that was done in probe-rs/vscode#63 and #1699, effectively means that Rust's panic message and stack trace, will be displayed to the user. In other words, this opens up the possibility to allow the use of Based on that, I will close this issue as completed. |
I think I would still implement this because it lets you shutdown gracefully instead of crashing the DAP server :) |
The code posted above is done and tested and can be implemented. However, the current version of Rust obscures the original panic message and stack trace. Until this RFC completes, the current experience is still better (more informative for the user). We can keep this issue open until then :) |
Uhm, I am pretty sure it should be possible to log the panic :) |
It is currently being logged, but as soon as you hide it behind a |
The DAP server runs as a background task when the VSCode extension is used. To ensure the process doesn't "disappear" when it encounters a Rust
panic
, we deliberately avoided allpanic
situations, by adding specific errors.This practice adds complexity to the code, and @Yatekii suggested we look at using https://doc.rust-lang.org/std/panic/fn.catch_unwind.html to allow the DAP server to maintain good usability, while also allowing the ergonomic use of
panic
.The text was updated successfully, but these errors were encountered: