Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move InvalidResponseError to g3pylib folder
  • Loading branch information
osode authored and m4reko committed Aug 22, 2022
commit 6a9c01259b9ff878442a734c316024c3116070b5
2 changes: 2 additions & 0 deletions src/g3pylib/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class InvalidResponseError(Exception):
"""Raised when the server responds with an invalid message."""
5 changes: 1 addition & 4 deletions src/g3pylib/recordings/recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
import aiohttp

from g3pylib._utils import APIComponent, EndpointKind
from g3pylib.exceptions import InvalidResponseError
from g3pylib.g3typing import URI
from g3pylib.websocket import G3WebSocketClientProtocol


class InvalidResponseError(Exception):
"""Raised when an invalid response is received from the Glasses3 unit."""


class Recording(APIComponent):
def __init__(
self, connection: G3WebSocketClientProtocol, api_base_uri: URI, uuid: str
Expand Down
8 changes: 2 additions & 6 deletions src/g3pylib/websocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from websockets.typing import Subprotocol

from g3pylib import _utils
from g3pylib.exceptions import InvalidResponseError
from g3pylib.g3typing import (
URI,
JSONDict,
Expand All @@ -23,12 +24,7 @@
SignalId,
SubscriptionId,
)
from g3pylib.websocket.exceptions import (
GlassesError,
InvalidResponseError,
SubscribeError,
UnsubscribeError,
)
from g3pylib.websocket.exceptions import GlassesError, SubscribeError, UnsubscribeError


def connect(ws_url: str) -> websockets.legacy.client.Connect:
Expand Down
4 changes: 0 additions & 4 deletions src/g3pylib/websocket/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ class UnsubscribeError(Exception):
"""Raised when unsubscribing to a signal is unsuccessful."""


class InvalidResponseError(Exception):
"""Raised when the server responds with an invalid message."""


class GlassesError(Exception):
"""Raised when the glasses responds with an error websocket message."""

Expand Down