Log locate errors (#282)

This commit is contained in:
Maciej Hirsz
2020-08-26 09:34:35 +02:00
committed by GitHub
parent 390a5a36f4
commit 0f13c76fe1
+10 -1
View File
@@ -136,7 +136,16 @@ impl Locator {
where
for<'de> T: Deserialize<'de>,
{
match self.client.get(url).send()?.json::<T>() {
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::<T>() {
Ok(result) => Ok(Some(result)),
Err(err) => {
debug!("JSON error for ip location: {:?}", err);