Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
Signed-off-by: xxchan <[email protected]>
  • Loading branch information
xxchan committed Apr 11, 2024
1 parent 7bcb639 commit b48f0a9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions sqllogictest/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,12 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
cmd.stderr(std::process::Stdio::piped());
let result = D::run_command(cmd).await;
#[derive(thiserror::Error, Debug)]
#[error("process exited unsuccessfully: {0}\nstdout: {1}\nstderr: {2}")]
struct SystemError(ExitStatus, String, String);
#[error("process exited unsuccessfully: {status}\nstdout: {stdout}\nstderr: {stderr}")]
struct SystemError {
status: ExitStatus,
stdout: String,
stderr: String,
}

let mut stdout = None;
let error: Option<AnyError> = match result {
Expand All @@ -658,11 +662,11 @@ impl<D: AsyncDB, M: MakeConnection<Conn = D>> Runner<D, M> {
}
None
} else {
Some(Arc::new(SystemError(
output.status,
String::from_utf8_lossy(&output.stdout).to_string(),
String::from_utf8_lossy(&output.stderr).to_string(),
)))
Some(Arc::new(SystemError {
status: output.status,
stdout: String::from_utf8_lossy(&output.stdout).to_string(),
stderr: String::from_utf8_lossy(&output.stderr).to_string(),
}))
}
}
Err(e) => Some(Arc::new(e)),
Expand Down

0 comments on commit b48f0a9

Please sign in to comment.