Skip to content

Commit

Permalink
fix(sunrise): Raise correct exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroWave022 committed Oct 13, 2023
1 parent 37bfe2d commit 2d74746
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yr_weather/sunrise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2d74746

Please sign in to comment.