Skip to content

Commit

Permalink
Clarify Pantsd error message wording
Browse files Browse the repository at this point in the history
# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano committed May 21, 2021
1 parent 0e6d204 commit ab5a1d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/rust/engine/nailgun/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ pub async fn client_execute(
let socket = TcpStream::connect((Ipv4Addr::new(127, 0, 0, 1), port))
.await
.map_err(|err| {
NailgunClientError::PreConnect(format!(
"Nailgun client error connecting to localhost: {}",
err
))
NailgunClientError::PreConnect(format!("Failed to connect to localhost: {}", err))
})?;

let mut child = nails::client::handle_connection(config, socket, command, async {
Expand All @@ -155,7 +152,7 @@ pub async fn client_execute(
stdin_read
})
.await
.map_err(|err| NailgunClientError::PreConnect(format!("Failed to start remote task: {}", err)))?;
.map_err(|err| NailgunClientError::PreConnect(format!("Failed to start: {}", err)))?;

handle_client_output(
child.output_stream.take().unwrap(),
Expand All @@ -167,7 +164,7 @@ pub async fn client_execute(
let exit_code: ExitCode = child
.wait()
.await
.map_err(|err| NailgunClientError::PostConnect(format!("Nailgun client error: {}", err)))?;
.map_err(|err| NailgunClientError::PostConnect(format!("Failed during execution: {}", err)))?;

Ok(exit_code.0)
}
2 changes: 1 addition & 1 deletion src/rust/engine/src/externs/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ py_class!(class PyNailgunClient |py| {
)).map(|code| code.to_py_object(py)).map_err(|e| match e{
NailgunClientError::PreConnect(err_str) => PyErr::new::<NailgunConnectionException, _>(py, (err_str,)),
NailgunClientError::PostConnect(s) => {
let err_str = format!("Nailgun client error: {:?}", s);
let err_str = format!("Pantsd client error: {}", s);
PyErr::new::<NailgunClientException, _>(py, (err_str,))
},
NailgunClientError::BrokenPipe => {
Expand Down

0 comments on commit ab5a1d8

Please sign in to comment.