-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
📎 Improve internal error reporting #2730
Comments
Have you checked if it's technically possible to retrieve the information you'd like to see? Those are panics generated by Rust, and we catch these panics with some simple hooks, which means that we might not have all the desired information you wished to see. The only information we might be able to have, is the stack trace, however if it's not printed here, I doubt we have it. |
No, I haven't checked how to proceed, it's an invitation to investigate. Perhaps I should clarify the issue description.
I was thinking of doing this to get some information such as the currently running linter rule. |
We can wrap evaluating rules with catch_unwind to catch panics, and that would allow us to surface the rule that was being evaluated. I'm not so sure about being able to surface the actual user code that resulted in the panic. I could take a stab at implementing |
What if we did the biome/crates/biome_analyze/src/registry.rs Line 431 in 5088667
This function seems to have all the context we want in the new error messages. |
Description
#2659 brought something to light for me: internal error reporting is uninformative for users and doesn't help them to understand the source of the issue or how to find a workaround.
Biome is a toolchain, a bug can come from any tool, and it is hard to tell without investment of the user.
It would be nice if we could specify which tool caused the error, and even in what unit of work (e.g. a rule for the linter), and the linted/formatted node - if any - (the queried node in the case of the linter).
Taking #2659 as an example.
Here is the current error:
And here is an example of a better diagnostic:
The text was updated successfully, but these errors were encountered: