Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
feat: add error information for debugging connection drops
Browse files Browse the repository at this point in the history
Closes #1002
  • Loading branch information
bbangert committed Dec 4, 2017
1 parent e4503d5 commit ffa7865
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion autopush_rs/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ where
}

fn transition(&mut self) -> Poll<ClientState, Error> {
let host = self.data.host.clone();
let next_state = match self.state {
ClientState::FinishSend(None, None) => {
return Err("Bad state, should not have nothing to do".into())
Expand Down Expand Up @@ -466,7 +467,12 @@ where
ClientState::ShutdownCleanup(ref mut err) => {
debug!("State: ShutdownCleanup");
if let Some(err_obj) = err.take() {
debug!("Error for shutdown: {}", err_obj);
let mut error = err_obj.to_string();
for err in err_obj.iter().skip(1) {
error.push_str("\n");
error.push_str(&err.to_string());
}
debug!("Error for shutdown of {}: {}", host, error);
};
self.data.shutdown();
ClientState::Done
Expand Down

0 comments on commit ffa7865

Please sign in to comment.