Merge pull request #166 from itsdeka/mattfix

Handle InvalidStatusCode exception
This commit is contained in:
Vigan Abdurrahmani
2021-10-11 11:35:59 +02:00
committed by GitHub
4 changed files with 7 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
1.2.2
-) WS bugfix (exception InvalidStatusCode not handled)
1.2.1
-) Added orderbook implementation example (ws)

View File

@@ -2,4 +2,4 @@
This module contains the current version of the bfxapi lib
"""
__version__ = '1.2.1'
__version__ = '1.2.2'

View File

@@ -13,7 +13,7 @@ from pyee import AsyncIOEventEmitter
from ..utils.custom_logger import CustomLogger
# websocket exceptions
from websockets.exceptions import ConnectionClosed
from websockets.exceptions import ConnectionClosed, InvalidStatusCode
class AuthError(Exception):
"""
@@ -141,7 +141,7 @@ class GenericWebsocket:
await asyncio.sleep(0)
message = await websocket.recv()
await self.on_message(sId, message)
except (ConnectionClosed, socket.error) as e:
except (ConnectionClosed, socket.error, InvalidStatusCode) as e:
self.sockets[sId].set_disconnected()
if self.sockets[sId].isAuthenticated:
self.sockets[sId].set_unauthenticated()

View File

@@ -11,7 +11,7 @@ from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='bitfinex-api-py',
version='1.2.1',
version='1.2.2',
description='Official Bitfinex Python API',
long_description='A Python reference implementation of the Bitfinex API for both REST and websocket interaction',
long_description_content_type='text/markdown',