Skip to content

Commit 08aec37

Browse files
committed
Exit directly instead of panicking
1 parent 78ced8e commit 08aec37

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
@@ -124,11 +124,15 @@ impl Build {
124124
false
125125
}
126126

127-
#[track_caller]
127+
/// Exits the process on failure. Use `try_build` to handle the error.
128128
pub fn build(&mut self) -> Artifacts {
129129
match self.try_build() {
130130
Ok(a) => a,
131-
Err(e) => panic!("\n\n\n{e}\n\n\n"),
131+
Err(e) => {
132+
println!("cargo:warning=openssl-src: failed to build OpenSSL from source");
133+
eprintln!("\n\n\n{e}\n\n\n");
134+
std::process::exit(1);
135+
}
132136
}
133137
}
134138

0 commit comments

Comments
 (0)