From 0f13c76fe1cb3b9d212889998ae19716bd61b89d Mon Sep 17 00:00:00 2001 From: Maciej Hirsz <1096222+maciejhirsz@users.noreply.github.com> Date: Wed, 26 Aug 2020 09:34:35 +0200 Subject: [PATCH] Log locate errors (#282) --- backend/src/util/location.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/backend/src/util/location.rs b/backend/src/util/location.rs index db97bd7..a7ae862 100644 --- a/backend/src/util/location.rs +++ b/backend/src/util/location.rs @@ -136,7 +136,16 @@ impl Locator { where for<'de> T: Deserialize<'de>, { - match self.client.get(url).send()?.json::() { + let mut result = match self.client.get(url).send() { + Ok(result) => result, + Err(error) => { + info!("Failed query {} ({:?})", url, error); + + return Err(error); + } + }; + + match result.json::() { Ok(result) => Ok(Some(result)), Err(err) => { debug!("JSON error for ip location: {:?}", err);