diff --git a/crates/remote_server/src/unix.rs b/crates/remote_server/src/unix.rs
index 78833d72ca..e63328094a 100644
--- a/crates/remote_server/src/unix.rs
+++ b/crates/remote_server/src/unix.rs
@@ -672,12 +672,16 @@ pub fn execute_proxy(identifier: String, is_reconnecting: bool) -> Result<()> {
Ok(())
}
-fn kill_running_server(pid: u32, paths: &ServerPaths) -> Result<()> {
+#[derive(Debug, Error)]
+#[error("failed to kill existing server")]
+pub(crate) struct KillRunningServerError(std::io::Error);
+
+fn kill_running_server(pid: u32, paths: &ServerPaths) -> Result<(), KillRunningServerError> {
log::info!("killing existing server with PID {}", pid);
std::process::Command::new("kill")
.arg(pid.to_string())
.output()
- .context("failed to kill existing server")?;
+ .map_err(KillRunningServerError)?;
for file in [
&paths.pid_file,
@@ -772,7 +776,15 @@ fn spawn_server(paths: &ServerPaths) -> Result<(), SpawnServerError> {
Ok(())
}
-fn check_pid_file(path: &Path) -> Result