Skip to content

Commit

Permalink
propagate docker build error up (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregcusack authored Jul 26, 2024
1 parent 8130bf8 commit 5a762cb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,12 @@ impl DockerConfig {
.arg("-c")
.arg(&command)
.stdout(Stdio::null())
.stderr(Stdio::null())
.spawn()
.expect("Failed to execute command")
.wait_with_output()
.stderr(Stdio::piped())
.output()
.map_err(Box::new)?;

if !output.status.success() {
return Err(output.status.to_string().into());
return Err(String::from_utf8_lossy(&output.stderr).into());
}
progress_bar.finish_and_clear();

Expand Down Expand Up @@ -248,7 +246,7 @@ COPY --chown=solana:solana ./config-k8s/bench-tps-{index}.yml /home/solana/clien
.arg("-c")
.arg(&command)
.stdout(Stdio::null())
.stderr(Stdio::null())
.stderr(Stdio::piped())
.spawn()?;

Ok(child)
Expand All @@ -269,7 +267,7 @@ COPY --chown=solana:solana ./config-k8s/bench-tps-{index}.yml /home/solana/clien
for child in children? {
let output = child.wait_with_output()?;
if !output.status.success() {
return Err(output.status.to_string().into());
return Err(String::from_utf8_lossy(&output.stderr).into());
}
}
progress_bar.finish_and_clear();
Expand Down

0 comments on commit 5a762cb

Please sign in to comment.