mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-18 22:34:21 +01:00
Delete HandlerNotFound exception (from bfxapi.websocket.exceptions).
This commit is contained in:
@@ -10,7 +10,6 @@ __all__ = [
|
|||||||
"WebSocketAuthenticationRequired",
|
"WebSocketAuthenticationRequired",
|
||||||
"InvalidAuthenticationCredentials",
|
"InvalidAuthenticationCredentials",
|
||||||
"EventNotSupported",
|
"EventNotSupported",
|
||||||
"HandlerNotFound",
|
|
||||||
"OutdatedClientVersion"
|
"OutdatedClientVersion"
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -54,12 +53,6 @@ class EventNotSupported(BfxWebSocketException):
|
|||||||
This error indicates a failed attempt to subscribe to an event not supported by the BfxWebSocketClient.
|
This error indicates a failed attempt to subscribe to an event not supported by the BfxWebSocketClient.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class HandlerNotFound(BfxWebSocketException):
|
|
||||||
"""
|
|
||||||
This error indicates that a handler was not found for an incoming message.
|
|
||||||
"""
|
|
||||||
|
|
||||||
class OutdatedClientVersion(BfxWebSocketException):
|
class OutdatedClientVersion(BfxWebSocketException):
|
||||||
"""
|
"""
|
||||||
This error indicates a mismatch between the client version and the server WSS version.
|
This error indicates a mismatch between the client version and the server WSS version.
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from ..exceptions import HandlerNotFound
|
|
||||||
|
|
||||||
from ...types import serializers
|
from ...types import serializers
|
||||||
|
|
||||||
from ...types.serializers import _Notification
|
from ...types.serializers import _Notification
|
||||||
@@ -60,8 +58,6 @@ class AuthenticatedEventsHandler:
|
|||||||
|
|
||||||
return self.event_emitter.emit(event, serializer.parse(*stream))
|
return self.event_emitter.emit(event, serializer.parse(*stream))
|
||||||
|
|
||||||
raise HandlerNotFound(f"No handler found for event of type <{abbrevation}>.")
|
|
||||||
|
|
||||||
def __notification(self, stream):
|
def __notification(self, stream):
|
||||||
event, serializer = "notification", _Notification(serializer=None)
|
event, serializer = "notification", _Notification(serializer=None)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from ..exceptions import HandlerNotFound
|
|
||||||
|
|
||||||
from ...types import serializers
|
from ...types import serializers
|
||||||
|
|
||||||
class PublicChannelsHandler:
|
class PublicChannelsHandler:
|
||||||
@@ -37,8 +35,6 @@ class PublicChannelsHandler:
|
|||||||
if (channel := subscription["channel"]) and channel in self.__handlers.keys():
|
if (channel := subscription["channel"]) and channel in self.__handlers.keys():
|
||||||
return self.__handlers[channel](_clear(subscription, "event", "channel", "chanId"), *stream)
|
return self.__handlers[channel](_clear(subscription, "event", "channel", "chanId"), *stream)
|
||||||
|
|
||||||
raise HandlerNotFound(f"No handler found for channel <{subscription['channel']}>.")
|
|
||||||
|
|
||||||
def __emit(self, event, sub, data):
|
def __emit(self, event, sub, data):
|
||||||
sub_id, should_emit_event = sub["subId"], True
|
sub_id, should_emit_event = sub["subId"], True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user