From 184b854747de31f201066637edcf540c97ec097b Mon Sep 17 00:00:00 2001 From: Skye Date: Thu, 14 Dec 2023 23:07:17 -0500 Subject: [PATCH] Add useful error to problems with geoip file --- src/tiles/local_time.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tiles/local_time.rs b/src/tiles/local_time.rs index 343313a..abcc8e9 100644 --- a/src/tiles/local_time.rs +++ b/src/tiles/local_time.rs @@ -2,6 +2,7 @@ use crate::config::LocalTimeConfig; use crate::output::OutputChannel; use crate::tile::Block; use chrono::prelude::*; +use eyre::Context; use maxminddb::geoip2; use std::convert::Infallible; @@ -31,7 +32,8 @@ async fn find_time_zone(config: LocalTimeConfig, sender: watch::Sender) - let Some(geoip_path) = &config.geoip_path else { eyre::bail!("geoip path not specified"); }; - let db_reader = maxminddb::Reader::open_readfile(geoip_path)?; + let db_reader = maxminddb::Reader::open_readfile(geoip_path) + .wrap_err("Could not read specified geoip file path")?; // Force IPv4 since we don't need to make a request for ipv6 let http_client = reqwest::Client::builder()