feat(launcher): Improve error message when download process fails. (#276)

This commit is contained in:
Nicolas Patry 2023-05-04 15:29:29 +02:00 committed by GitHub
parent f08343d44d
commit e68509add7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 2 deletions

View File

@ -627,8 +627,21 @@ fn download_convert_model(
return Err(LauncherError::DownloadError);
}
}
_ => {
tracing::error!("Download process exited with an unknown status.");
ExitStatus::Signaled(signal) => {
let mut err = String::new();
download_process
.stderr
.take()
.unwrap()
.read_to_string(&mut err)
.unwrap();
tracing::error!(
"Download process was signaled to shutdown with signal {signal}: {err}"
);
return Err(LauncherError::DownloadError);
}
e => {
tracing::error!("Download process exited with an unknown status.: {e:?}");
return Err(LauncherError::DownloadError);
}
}