Fix small bug in module bfxapi.exceptions.

This commit is contained in:
Davide Casale
2023-10-09 16:27:04 +02:00
parent 25881e77c8
commit 378e89b504
3 changed files with 25 additions and 60 deletions

View File

@@ -1,65 +1,47 @@
from ..exceptions import BfxBaseException
# pylint: disable-next=wildcard-import,unused-wildcard-import
from bfxapi._exceptions import *
__all__ = [
"BfxWebSocketException",
"ConnectionNotOpen",
"FullBucketError",
"ZeroConnectionsError",
"ReconnectionTimeoutError",
"ActionRequiresAuthentication",
"InvalidAuthenticationCredentials",
"UnknownChannelError",
"UnknownEventError",
"OutdatedClientVersion"
]
class BfxWebSocketException(BfxBaseException):
"""
Base class for all custom exceptions in bfxapi/websocket/exceptions.py.
"""
class ConnectionNotOpen(BfxWebSocketException):
class ConnectionNotOpen(BfxBaseException):
"""
This error indicates an attempt to communicate via websocket before starting the connection with the servers.
"""
class FullBucketError(BfxWebSocketException):
class FullBucketError(BfxBaseException):
"""
Thrown when a user attempts a subscription but all buckets are full.
"""
class ZeroConnectionsError(BfxWebSocketException):
class ZeroConnectionsError(BfxBaseException):
"""
This error indicates an attempt to subscribe to a public channel while the number of connections is 0.
"""
class ReconnectionTimeoutError(BfxWebSocketException):
class ReconnectionTimeoutError(BfxBaseException):
"""
This error indicates that the connection has been offline for too long without being able to reconnect.
"""
class ActionRequiresAuthentication(BfxWebSocketException):
class ActionRequiresAuthentication(BfxBaseException):
"""
This error indicates an attempt to access a protected resource without logging in first.
"""
class InvalidAuthenticationCredentials(BfxWebSocketException):
"""
This error indicates that the user has provided incorrect credentials (API-KEY and API-SECRET) for authentication.
"""
class UnknownChannelError(BfxWebSocketException):
class UnknownChannelError(BfxBaseException):
"""
Thrown when a user attempts to subscribe to an unknown channel.
"""
class UnknownEventError(BfxWebSocketException):
class UnknownSubscriptionError(BfxBaseException):
"""
Thrown when a user attempts to reference an unknown subscription.
"""
class UnknownEventError(BfxBaseException):
"""
Thrown when a user attempts to add a listener for an unknown event.
"""
class OutdatedClientVersion(BfxWebSocketException):
class VersionMismatchError(BfxBaseException):
"""
This error indicates a mismatch between the client version and the server WSS version.
"""