summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-12-04 13:26:53 +0100
committerDavid Lönnhager <david.l@mullvad.net>2020-12-07 11:16:13 +0100
commit5d1f74e50a95d031fda35e733db89303571940b4 (patch)
treeb9f493546b32ca151135b2ab7d0a505d3cea2dd8
parentff7a06f8c79d4fe959853dcfecfeb37e04d0da54 (diff)
downloadmullvadvpn-5d1f74e50a95d031fda35e733db89303571940b4.tar.xz
mullvadvpn-5d1f74e50a95d031fda35e733db89303571940b4.zip
Log entire error chain in geoip
-rw-r--r--mullvad-daemon/src/geoip.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/mullvad-daemon/src/geoip.rs b/mullvad-daemon/src/geoip.rs
index 953780b6f2..1047d3bb15 100644
--- a/mullvad-daemon/src/geoip.rs
+++ b/mullvad-daemon/src/geoip.rs
@@ -1,6 +1,7 @@
use futures::join;
use mullvad_rpc::{self, rest::RequestServiceHandle};
use mullvad_types::location::{AmIMullvad, GeoIpLocation};
+use talpid_types::ErrorExt;
const URI_V4: &str = "https://ipv4.am.i.mullvad.net/json";
const URI_V6: &str = "https://ipv6.am.i.mullvad.net/json";
@@ -11,7 +12,7 @@ pub async fn send_location_request(
let v4_sender = request_sender.clone();
let v4_future = async move {
let location = send_location_request_internal(URI_V4, v4_sender).await?;
- Ok(GeoIpLocation::from(location))
+ Ok::<GeoIpLocation, mullvad_rpc::rest::Error>(GeoIpLocation::from(location))
};
let v6_sender = request_sender.clone();
let v6_future = async move {
@@ -28,11 +29,17 @@ pub async fn send_location_request(
Ok(v4)
}
(Ok(v4), Err(e)) => {
- log::debug!("Unable to fetch IPv6 GeoIP location: {}", e);
+ log::debug!(
+ "{}",
+ e.display_chain_with_msg("Unable to fetch IPv6 GeoIP location")
+ );
Ok(v4)
}
(Err(e), Ok(v6)) => {
- log::debug!("Unable to fetch IPv4 GeoIP location: {}", e);
+ log::debug!(
+ "{}",
+ e.display_chain_with_msg("Unable to fetch IPv4 GeoIP location")
+ );
Ok(v6)
}
(Err(e_v4), Err(_)) => Err(e_v4),