Skip to content

Commit

Permalink
raise exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed Sep 12, 2022
1 parent 1be7df4 commit e8d7df2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyipma/auxiliar.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

LOGGER = logging.getLogger(__name__) # pylint: disable=invalid-name

class IPMAException(Exception):
pass

class AuxiliarParser:
def __init__(self, api: IPMA_API, type="location"):
Expand All @@ -31,7 +33,7 @@ async def get_location(self, lon, lat):
raw = await self.api.retrieve(url=self.endpoint)

if raw is None:
raise Exception(f"Could not retrieve location for {lon}, {lat}")
raise IPMAException(f"Could not retrieve location for {lon}, {lat}")

self.data = self._data_to_obj_list(raw)

Expand Down

0 comments on commit e8d7df2

Please sign in to comment.