1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00

fix(upgrade): better error message when check_exe fails (#25133)

Fixes https://github.com/denoland/deno/issues/24971

Fixes the panic. We can give a more personalized error by checking the
macOS version but probably not worth the effort.
This commit is contained in:
Divy Srivastava 2024-08-21 07:25:17 -07:00 committed by GitHub
parent 76990df6fa
commit e2c50f7e8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -972,8 +972,13 @@ fn check_exe(exe_path: &Path) -> Result<(), AnyError> {
.arg("-V")
.stderr(std::process::Stdio::inherit())
.output()?;
assert!(output.status.success());
Ok(())
if !output.status.success() {
bail!(
"Failed to validate Deno executable. This may be because your OS is unsupported or the executable is corrupted"
)
} else {
Ok(())
}
}
#[derive(Debug)]