diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-08-31 09:35:00 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-09-03 08:05:18 -0300 |
| commit | 3a13f4bc36f9ad4fe7e045cb2b98a73f5f93e9fb (patch) | |
| tree | a94dd7f6986305f5d76449795961f1dc6cf84d24 | |
| parent | efb2cbe3fa0284711f7f2d6860c2264db03fa4e9 (diff) | |
| download | mullvadvpn-3a13f4bc36f9ad4fe7e045cb2b98a73f5f93e9fb.tar.xz mullvadvpn-3a13f4bc36f9ad4fe7e045cb2b98a73f5f93e9fb.zip | |
Log full chain of errors
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/connected_state.rs | 7 | ||||
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/connecting_state.rs | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/talpid-core/src/tunnel_state_machine/connected_state.rs b/talpid-core/src/tunnel_state_machine/connected_state.rs index d207e9a9fb..ce8175d814 100644 --- a/talpid-core/src/tunnel_state_machine/connected_state.rs +++ b/talpid-core/src/tunnel_state_machine/connected_state.rs @@ -1,3 +1,4 @@ +use error_chain::ChainedError; use futures::sync::{mpsc, oneshot}; use futures::{Async, Future, Stream}; @@ -92,7 +93,8 @@ impl ConnectedState { match self.set_security_policy(shared_values) { Ok(()) => SameState(self), Err(error) => { - error!("{}", error.chain_err(|| "Failed to update security policy")); + error!("{}", error.display_chain()); + NewState(DisconnectingState::enter( shared_values, ( @@ -161,7 +163,8 @@ impl TunnelState for ConnectedState { TunnelStateTransition::Connected, ), Err(error) => { - error!("{}", error.chain_err(|| "Failed to set security policy")); + error!("{}", error.display_chain()); + DisconnectingState::enter( shared_values, ( diff --git a/talpid-core/src/tunnel_state_machine/connecting_state.rs b/talpid-core/src/tunnel_state_machine/connecting_state.rs index d1c16bac1d..8aee60fd69 100644 --- a/talpid-core/src/tunnel_state_machine/connecting_state.rs +++ b/talpid-core/src/tunnel_state_machine/connecting_state.rs @@ -4,6 +4,7 @@ use std::sync::Mutex; use std::thread; use std::time::{Duration, Instant}; +use error_chain::ChainedError; use futures::sink::Wait; use futures::sync::{mpsc, oneshot}; use futures::{Async, Future, Sink, Stream}; @@ -141,7 +142,7 @@ impl ConnectingState { Ok(_) => debug!("Tunnel has finished without errors"), Err(error) => { let chained_error = error.chain_err(|| "Tunnel has stopped unexpectedly"); - warn!("{}", chained_error); + warn!("{}", chained_error.display_chain()); } } @@ -205,7 +206,8 @@ impl ConnectingState { match Self::set_security_policy(shared_values, self.tunnel_endpoint, allow_lan) { Ok(()) => SameState(self), Err(error) => { - error!("{}", error.chain_err(|| "Failed to update security policy")); + error!("{}", error.display_chain()); + NewState(DisconnectingState::enter( shared_values, ( |
