Skip to content

Commit

Permalink
Decorate validate_server_version and get_info with handle_error
Browse files Browse the repository at this point in the history
  • Loading branch information
emontnemery committed Oct 29, 2024
1 parent 73fa4fa commit ba6e82a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go2rtc_client/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def __init__(self, client: _BaseClient) -> None:
"""Initialize Client."""
self._client = client

@handle_error
async def get_info(self) -> ApplicationInfo:
"""Get application info."""
resp = await self._client.request("GET", self.PATH)
Expand Down Expand Up @@ -143,6 +144,7 @@ def __init__(self, websession: ClientSession, server_url: str) -> None:
self.streams: Final = _StreamClient(self._client)
self.webrtc: Final = _WebRTCClient(self._client)

@handle_error
async def validate_server_version(self) -> bool:
"""Validate the server version is compatible."""
application_info = await self.application.get_info()
Expand Down

0 comments on commit ba6e82a

Please sign in to comment.