Skip to content

Commit

Permalink
Better error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
FL550 committed Aug 22, 2024
1 parent a51e5cb commit d4b605b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions simple_dwd_weatherforecast/dwdforecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}")

0 comments on commit d4b605b

Please sign in to comment.