Skip to content

Commit 40d9241

Browse files
authored
release 0.0.317 (#52)
* nicer ws errors --------- Co-authored-by: nggit <[email protected]>
1 parent 0c19d44 commit 40d9241

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='tremolo',
10-
version='0.0.316',
10+
version='0.0.317',
1111
license='MIT',
1212
author='nggit',
1313
author_email='[email protected]',

tests/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
__all__ = ('function', 'getcontents', 'chunked_detected', 'read_chunked',
2-
'valid_chunked', 'create_dummy_data', 'create_chunked_body',
3-
'create_dummy_body', 'create_multipart_body', 'logger')
1+
__all__ = (
2+
'function', 'getcontents', 'chunked_detected', 'read_chunked',
3+
'valid_chunked', 'create_dummy_data', 'create_chunked_body',
4+
'create_dummy_body', 'create_multipart_body', 'logger'
5+
)
46

57
import asyncio # noqa: E402
68
import logging # noqa: E402

tremolo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.0.316'
1+
__version__ = '0.0.317'
22

33
from .tremolo import Tremolo # noqa: E402
44
from . import exceptions # noqa: E402,F401

tremolo/lib/websocket.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@ async def accept(self):
3535
await self.response.write(None)
3636

3737
async def recv(self):
38-
first_byte, second_byte = await self.request.recv(2)
38+
try:
39+
first_byte, second_byte = await self.request.recv(2)
40+
except ValueError as exc:
41+
raise WebSocketClientClosed(
42+
'connection closed: recv failed'
43+
) from exc
44+
3945
# we don't use FIN
4046
# fin = (first_byte & 0x80) >> 7
4147
opcode = first_byte & 0x0f

0 commit comments

Comments
 (0)