-
Notifications
You must be signed in to change notification settings - Fork 89
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
More descriptive errors (file and line, what it was trying to do) #740
Comments
|
To convert an error into one which is more descriptive you use the associated https://github.com/rune-rs/rune/blob/main/crates/rune-wasm/src/lib.rs#L269 https://github.com/rune-rs/rune/blob/main/crates/rune-wasm/src/lib.rs#L301 To explain, detailed diagnostics has a memory overhead. To emit it you need to provide the context that was used to compile the program, all loaded sources, and the compiled unit (with debug info). |
Thank you, I propose adding some cross references to the docs for Discoverability when trying to solve an issue is a probkem in the rustdoc of many large Rust projects (not only Rune, I have struggled with clap and bpaf before for example). Part of that is due to the sub-par search function of rustdoc (only matching names of types/functions). |
Actually, looking at it again, I'm not sure how I missed the |
Consider this rune example (involving some custom types):
sysinfo.host_name
returns aOption<String>
. The first print works, the second doesn't, since Option cannot be formatted like this.The issue however is that of the error message:
I don't see a way to extract a more useful error message from this. I would like one or more of:
println!
didn't work, sincedbg()
did, which was completely the wrong place to be looking).Anything to make this error more human readable.
Even the
at
orchain
members onVmError
contain nothing useful when I print them (andVmErrorAt
appears to be a private type as well according to the docs, since it isn't a clickable link):The text was updated successfully, but these errors were encountered: