From 2d74746dc0842a118857fb445fcbf4e5b23fdae3 Mon Sep 17 00:00:00 2001 From: ZeroWave022 <36341766+ZeroWave022@users.noreply.github.com> Date: Fri, 13 Oct 2023 22:09:14 +0200 Subject: [PATCH] fix(sunrise): Raise correct exception --- yr_weather/sunrise.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yr_weather/sunrise.py b/yr_weather/sunrise.py index a5542fe..74fe1ba 100644 --- a/yr_weather/sunrise.py +++ b/yr_weather/sunrise.py @@ -29,14 +29,14 @@ def _get_events(self, event_type: str, **kwargs) -> Union[APISunData, APIMoonDat # Ensure correct variable types. if not isinstance(date, str): - raise ValueError("Type of 'date' must be str.") + raise TypeError("Type of 'date' must be str.") if not isinstance(lat, (int, float)) or not isinstance(lon, (int, float)): - raise ValueError("Type of 'lat' and 'lon' must be int or float.") + raise TypeError("Type of 'lat' and 'lon' must be int or float.") if offset: if not isinstance(offset, str): - raise ValueError("Type of 'offset' must be str.") + raise TypeError("Type of 'offset' must be str.") # Ensure offset is valid. if not self._ensure_valid_offset(offset):