Print error cause chain on failures in build.rs
diff --git a/src/lib.rs b/src/lib.rs
index 509cfa6..3267b3f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -370,6 +370,7 @@
}
use crate::error::Result;
+use anyhow::anyhow;
use std::fs;
use std::io::{self, Write};
use std::path::Path;
@@ -442,7 +443,7 @@
match try_generate_bridge(rust_source_file.as_ref()) {
Ok(build) => build,
Err(err) => {
- let _ = writeln!(io::stderr(), "\n\ncxxbridge error: {}\n\n", err);
+ let _ = writeln!(io::stderr(), "\n\ncxxbridge error: {:?}\n\n", anyhow!(err));
process::exit(1);
}
}