Skip to content

Commit 32ac321

Browse files
authored
Decorate validate_server_version and get_info with handle_error (#18)
1 parent 73fa4fa commit 32ac321

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

go2rtc_client/rest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def __init__(self, client: _BaseClient) -> None:
6868
"""Initialize Client."""
6969
self._client = client
7070

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

147+
@handle_error
146148
async def validate_server_version(self) -> bool:
147149
"""Validate the server version is compatible."""
148150
application_info = await self.application.get_info()

0 commit comments

Comments
 (0)