Skip to content

Commit

Permalink
improve timeout errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JojiiOfficial committed Aug 16, 2020
1 parent eb1cc57 commit 379bb0a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sv/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ impl Service {

// Wait for the command to take effect
// print the result
Ok(self.await_command(cmd, timeout, kill_on_timeout)?)
match self.await_command(cmd, timeout, kill_on_timeout) {
Ok(s) => Ok(s),
Err(err) => match err {
err::Timeout() => Ok("timeout".to_owned()),
err::ForceKilled() => Ok("fkilled".to_owned()),
_ => Err(err),
},
}
}

fn await_command(
Expand Down

0 comments on commit 379bb0a

Please sign in to comment.