Skip to content

Commit 2d9057e

Browse files
committed
Exit directly instead of panicking
1 parent 8668aef commit 2d9057e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,15 @@ impl Build {
122122
false
123123
}
124124

125-
#[track_caller]
125+
/// Exits the process on failure. Use `try_build` to handle the error.
126126
pub fn build(&mut self) -> Artifacts {
127127
match self.try_build() {
128128
Ok(a) => a,
129-
Err(e) => panic!("\n\n\n{e}\n\n\n"),
129+
Err(e) => {
130+
println!("cargo:warning=openssl-src: failed to build OpenSSL from source");
131+
eprintln!("\n\n\n{e}\n\n\n");
132+
std::process::exit(101); // same as a panic
133+
}
130134
}
131135
}
132136

0 commit comments

Comments
 (0)