diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-12-19 10:29:59 -0200 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-01-09 07:44:06 -0200 |
| commit | 8768f64ea9b8df2483735e4df92272cf2163deee (patch) | |
| tree | 7b56994ba8f65d677fbe00adadcbce29cbcc85ce | |
| parent | df7131022e3a61ff7fe2b50a9f513110fb81c18e (diff) | |
| download | mullvadvpn-8768f64ea9b8df2483735e4df92272cf2163deee.tar.xz mullvadvpn-8768f64ea9b8df2483735e4df92272cf2163deee.zip | |
Export `OpenVpnMonitoringError` in `TunnelMonitor`
| -rw-r--r-- | talpid-core/src/tunnel/mod.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs index c06ee3d8e6..dc0d935ded 100644 --- a/talpid-core/src/tunnel/mod.rs +++ b/talpid-core/src/tunnel/mod.rs @@ -38,9 +38,9 @@ const OPENVPN_BIN_FILENAME: &str = "openvpn.exe"; error_chain! { errors { - /// An error indicating there was an error listening for events from the VPN tunnel. - TunnelMonitoringError { - description("Error while setting up or processing events from the VPN tunnel") + /// There was an error preparing to listen for events from the VPN tunnel. + TunnelMonitorSetUpError { + description("Error while setting up to listen for events from the VPN tunnel") } /// The OpenVPN binary was not found. OpenVpnNotFound(path: PathBuf) { @@ -74,6 +74,12 @@ error_chain! { description("This tunnel protocol is not supported") } } + + links { + OpenVpnTunnelMonitoringError(openvpn::Error, openvpn::ErrorKind) + /// There was an error listening for events from the OpenVPN tunnel + ; + } } @@ -213,7 +219,7 @@ impl TunnelMonitor { Self::get_plugin_path(resource_dir)?, log, ) - .chain_err(|| ErrorKind::TunnelMonitoringError)?; + .chain_err(|| ErrorKind::TunnelMonitorSetUpError)?; Ok(TunnelMonitor { monitor, _user_pass_file: user_pass_file, @@ -340,9 +346,7 @@ impl TunnelMonitor { /// Consumes the monitor and blocks until the tunnel exits or there is an error. pub fn wait(self) -> Result<()> { - self.monitor - .wait() - .chain_err(|| ErrorKind::TunnelMonitoringError) + self.monitor.wait().map_err(Error::from) } } |
