diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 01aa48e..3bde03e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -66,6 +66,8 @@ enum KalbaError { IncorrectWrite(String, usize), #[error("Unable to find a version of python installed on the system. It may not be installed or in the PATH.")] PythonNotFound, + #[error("Pip install failed. Maybe you ran out of space?")] + PipInstallFailed, #[error("Python version ({0}) does not match. Version 3.8 or later is required for stanza")] WrongPythonVersion(String), } diff --git a/src-tauri/src/setup_stanza.rs b/src-tauri/src/setup_stanza.rs index 59ee270..481283d 100644 --- a/src-tauri/src/setup_stanza.rs +++ b/src-tauri/src/setup_stanza.rs @@ -116,7 +116,7 @@ pub async fn setup_stanza(state: State<'_, KalbaState>, window: Window) -> Resul message: Some("Downloading stanza (this may take a while)"), }, )?; - new_command( + let exit_status = new_command( data_dir .join(".venv") .join(if cfg!(target_os = "windows") { @@ -131,6 +131,10 @@ pub async fn setup_stanza(state: State<'_, KalbaState>, window: Window) -> Resul .spawn()? .wait()?; + if !exit_status.success() { + return Err(KalbaError::PipInstallFailed); + } + state.to_save.installing_stanza = false; Ok(()) }