slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.64k stars 607 forks source link

bundled translation: Better error reporting #6835

Closed ogoffart closed 2 days ago

ogoffart commented 2 days ago

forward the error up the stack instead of panicking while producing the llr

ogoffart commented 2 days ago

This is the kind of error we get from an unwrap() in a build.rs

error: failed to run custom build command for `printerdemo v1.9.0 (/home/rust/sixtyfps/sixtyfps/demos/printerdemo/rust)`

Caused by:
  process didn't exit successfully: `/home/rust/sixtyfps/sixtyfps/target/debug/build/printerdemo-e5584aa60a0bd351/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at demos/printerdemo/rust/build.rs:10:73:
  called `Result::unwrap()` on an `Err` value: CompileError(["Cannot load bundled translation: No such file or directory (os error 2)"])
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace