rhaiscript / rhai

Rhai - An embedded scripting language for Rust.
https://crates.io/crates/rhai
Apache License 2.0
3.63k stars 174 forks source link

Add `position` to `EvalAltResult::SystemError` #883

Closed sgpthomas closed 3 weeks ago

sgpthomas commented 1 month ago

For error reporting, it would be nice to have Position for SystemErrors. I'm imagining a case where some rust function, that is called from a Rhai context, produces some error. I want to be able to locate the Rhai position that caused this error so that I can report it nicely. Is this something that would be possible?

schungx commented 1 month ago

It would be possible, but then it would be a breaking change...

Maybe you can use another error variant?

schungx commented 3 weeks ago

Closing this for now. Feel free to reopen if there are further issues.