From d4b605beec8610c7def45bdba520d56f2cd820ee Mon Sep 17 00:00:00 2001 From: FL550 Date: Thu, 22 Aug 2024 17:34:43 +0000 Subject: [PATCH] Better error reporting --- simple_dwd_weatherforecast/dwdforecast.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simple_dwd_weatherforecast/dwdforecast.py b/simple_dwd_weatherforecast/dwdforecast.py index 2bb7fe3..cbf8e92 100644 --- a/simple_dwd_weatherforecast/dwdforecast.py +++ b/simple_dwd_weatherforecast/dwdforecast.py @@ -920,7 +920,7 @@ def download_uv_index(self): # uv_report.update({"lat": station[1]["lat"], "lon": station[1]["lon"]}) self.uv_reports[station[0]] = uv_report # type: ignore except Exception as error: - print(f"Error in download_weather_report: {type(error)} args: {error.args}") + print(f"Error in download_uv_index: {type(error)} args: {error.args}") def download_weather_report(self, region_code): url = f"https://www.dwd.de/DWD/wetter/wv_allg/deutschland/text/vhdl13_{region_code}.html" @@ -959,7 +959,7 @@ def download_latest_kml(self, stationid, force_hourly=False): with kmz.open(kmz.namelist()[0], "r") as kml: self.parse_kml(kml, force_hourly) except Exception as error: - print(f"Error in download_weather_report: {type(error)} args: {error.args}") + print(f"Error in download_latest_kml: {type(error)} args: {error.args}") def download_latest_report(self): station_id = self.station_id @@ -1008,4 +1008,4 @@ def download_latest_report(self): # Handle other status codes print(f"Failed to download report. Status code: {response.status_code}") except Exception as error: - print(f"Error in download_weather_report: {type(error)} args: {error.args}") + print(f"Error in download_latest_report: {type(error)} args: {error.args}")