mozilla / uniffi-rs

a multi-language bindings generator for rust
https://mozilla.github.io/uniffi-rs/
Mozilla Public License 2.0
2.77k stars 230 forks source link

Better errors on parse failures #337

Open mhammond opened 3 years ago

mhammond commented 3 years ago

eg, in the nimbus IDL, I removed the trailing semicolon from the first (ie, namespace) line and see:

thread 'main' panicked at 'There is redundant raw data after parsing', C:\Users\skip.cargo\registry\src\github.com-1ecc6299db9ec823\weedle-0.11.0\src\lib.rs:85:5 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread 'main' panicked at 'called Result::unwrap() on an Err value: Error while generating scaffolding code', build.rs:6:60 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

(no idea if other errors are the same - I stumbled on this "organically")

┆Issue is synchronized with this Jira Task ┆Issue Number: UNIFFI-34

rfk commented 3 years ago

no idea if other errors are the same

Yeah, the errors are almost universally bad here, sorry. I think the parser we're using is designed more for parsing known-good WebIDL files obtained from a spec than for doing iterative development of a new IDL file.