Skip to content

Commit

Permalink
improve error messages on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Nov 15, 2024
1 parent bb93749 commit 2ab12cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion backend/windmill-worker/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,15 @@ pub async fn save_in_cache(
}

fn tentatively_improve_error(err: Error, executable: &str) -> Error {
#[cfg(unix)]
let err_msg = "No such file or directory (os error 2)";

#[cfg(windows)]
let err_msg = "program not found";

if err
.to_string()
.contains("No such file or directory (os error 2)")
.contains(&err_msg)
{
return Error::InternalErr(format!("Executable {executable} not found on worker"));
}
Expand Down
2 changes: 1 addition & 1 deletion backend/windmill-worker/src/python_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ pub async fn uv_pip_compile(
.args(args)
.stdout(Stdio::piped())
.stderr(Stdio::piped());
let child_process = start_child_process(child_cmd, "/usr/local/bin/uv").await?;
let child_process = start_child_process(child_cmd, uv_cmd).await?;
append_logs(&job_id, &w_id, logs, db).await;
handle_child(
job_id,
Expand Down

0 comments on commit 2ab12cc

Please sign in to comment.