Skip to content

Commit

Permalink
Add extra info to cxx_gen errors
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Apr 17, 2023
1 parent 49f4dfc commit 73e2984
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ fn gen_cxxbridge() -> Result<()> {
path: "rust/cxx.h".to_string(),
kind: cxx_gen::IncludeKind::Quoted,
});
let output = cxx_gen::generate_header_and_cc(token_stream, &opt)
.expect("invalid bridge file: try updating `filenames` to match zcashd");
let output = cxx_gen::generate_header_and_cc(token_stream, &opt).unwrap_or_else(|err| {
panic!(
"invalid bridge file {filename}: {err}. Try updating `filenames` to match zcashd"
)
});

fs::write(out_path.join(format!("rust/{}.h", filename)), output.header).unwrap();
fs::write(
Expand Down

0 comments on commit 73e2984

Please sign in to comment.