fixed #152 - set error message.
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
ChangeLog
|
ChangeLog
|
||||||
============
|
============
|
||||||
|
|
||||||
|
- 0.26.0
|
||||||
|
|
||||||
|
- all WebSocketException provide message string (#152)
|
||||||
|
|
||||||
- 0.25.0
|
- 0.25.0
|
||||||
|
|
||||||
- fixed for Python 2.6(#151)
|
- fixed for Python 2.6(#151)
|
||||||
|
@@ -96,7 +96,7 @@ class WebSocketApp(object):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
if not self.sock or self.sock.send(data, opcode) == 0:
|
if not self.sock or self.sock.send(data, opcode) == 0:
|
||||||
raise WebSocketConnectionClosedException()
|
raise WebSocketConnectionClosedException("Connection is already closed.")
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
"""
|
"""
|
||||||
@@ -164,7 +164,7 @@ class WebSocketApp(object):
|
|||||||
break
|
break
|
||||||
if ping_timeout and self.last_ping_tm and time.time() - self.last_ping_tm > ping_timeout:
|
if ping_timeout and self.last_ping_tm and time.time() - self.last_ping_tm > ping_timeout:
|
||||||
self.last_ping_tm = 0
|
self.last_ping_tm = 0
|
||||||
raise WebSocketTimeoutException()
|
raise WebSocketTimeoutException("ping timed out")
|
||||||
|
|
||||||
if r:
|
if r:
|
||||||
op_code, frame = self.sock.recv_data_frame(True)
|
op_code, frame = self.sock.recv_data_frame(True)
|
||||||
|
@@ -952,7 +952,7 @@ class WebSocket(object):
|
|||||||
self.sock.close()
|
self.sock.close()
|
||||||
self.sock = None
|
self.sock = None
|
||||||
self.connected = False
|
self.connected = False
|
||||||
raise WebSocketConnectionClosedException()
|
raise WebSocketConnectionClosedException("Connection is already closed.")
|
||||||
return bytes
|
return bytes
|
||||||
|
|
||||||
def _recv_strict(self, bufsize):
|
def _recv_strict(self, bufsize):
|
||||||
|
Reference in New Issue
Block a user