diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-11-09 12:32:24 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-11-16 13:18:54 +0100 |
| commit | 3275b7eabd7ebec67819cb2b5f9dff3d3d692fe4 (patch) | |
| tree | 0562d09d99d72f333eba6c036b6185d228a932c8 /talpid-core/src | |
| parent | a3367e2824d27cef7e0a06b292fa59777e52c964 (diff) | |
| download | mullvadvpn-3275b7eabd7ebec67819cb2b5f9dff3d3d692fe4.tar.xz mullvadvpn-3275b7eabd7ebec67819cb2b5f9dff3d3d692fe4.zip | |
Log OpenVPN route setup errors
Diffstat (limited to 'talpid-core/src')
| -rw-r--r-- | talpid-core/src/tunnel/openvpn.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/talpid-core/src/tunnel/openvpn.rs b/talpid-core/src/tunnel/openvpn.rs index 73068334b9..c8fcc633c6 100644 --- a/talpid-core/src/tunnel/openvpn.rs +++ b/talpid-core/src/tunnel/openvpn.rs @@ -26,7 +26,7 @@ use std::{ thread, time::Duration, }; -use talpid_types::net::openvpn; +use talpid_types::{net::openvpn, ErrorExt}; use tokio::task; #[cfg(target_os = "linux")] use which; @@ -168,6 +168,7 @@ pub struct OpenVpnMonitor<C: OpenVpnBuilder = OpenVpnCommand> { server_join_handle: Option<task::JoinHandle<std::result::Result<(), event_server::Error>>>, } + impl OpenVpnMonitor<OpenVpnCommand> { /// Creates a new `OpenVpnMonitor` with the given listener and using the plugin at the given /// path. @@ -211,7 +212,10 @@ impl OpenVpnMonitor<OpenVpnCommand> { } tokio::task::block_in_place(|| { let routes = extract_routes(&env).unwrap(); - route_manager_handle.clone().add_routes(routes).unwrap(); + if let Err(error) = route_manager_handle.clone().add_routes(routes) { + log::error!("{}", error.display_chain()); + panic!("Failed to add routes"); + } }); return; } |
