From c0e1c1f0330961eb56d21195e012cdbf488a6359 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Thu, 2 Jun 2016 20:18:13 -0400 Subject: client: handle remote error properly --- src/client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index b7aeb74..4749c51 100644 --- a/src/client.rs +++ b/src/client.rs @@ -38,7 +38,8 @@ pub fn run_client(host: &str, local_file: &str, remote_file: &str, remote_is_dir let ssh_output = ssh_cmd.output().expect("couldn't get SSH sub-process output"); if !ssh_output.status.success() { - panic!("SSH problem: {}", String::from_utf8_lossy(&ssh_output.stderr)); + println!("Error on remote end: {}", String::from_utf8_lossy(&ssh_output.stderr)); + exit(-1); } let reply = String::from_utf8_lossy(&ssh_output.stdout); -- cgit v1.2.3