Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
jdejaegh committed Jun 16, 2024
1 parent d1fea9a commit c91afe9
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/open_irceline/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@


class IrcelineApiError(Exception):
"""Exception to indicate a general API error."""


class IrcelineApiCommunicationError(IrcelineApiError):
"""Exception to indicate a communication error."""


class IrcelineApiParametersError(IrcelineApiError):
"""Exception to indicate a parameter error."""
"""Exception to indicate an API error."""


class IrcelineClient:
Expand Down Expand Up @@ -74,7 +66,7 @@ async def get_rio_value(self,
r: ClientResponse = await self._api_wrapper(rio_wfs_base_url, querystring)
return self.format_result('rio', await r.json(), features)

async def get_rio_feature_types(self) -> Set[str]:
async def get_rio_capabilities(self) -> Set[str]:
"""
Fetch the list of possible features from the WFS server
:return: set of features available on the WFS server
Expand Down Expand Up @@ -168,8 +160,8 @@ async def _api_wrapper(self, url: str, querystring: dict):
return response

except asyncio.TimeoutError as exception:
raise IrcelineApiCommunicationError("Timeout error fetching information") from exception
raise IrcelineApiError("Timeout error fetching information") from exception
except (aiohttp.ClientError, socket.gaierror) as exception:
raise IrcelineApiCommunicationError("Error fetching information") from exception
raise IrcelineApiError("Error fetching information") from exception
except Exception as exception: # pylint: disable=broad-except
raise IrcelineApiError(f"Something really wrong happened! {exception}") from exception

0 comments on commit c91afe9

Please sign in to comment.