Merge pull request #233 from JustAMan/master
Handle more built-in exceptions that are not derived from Exception
This commit is contained in:
@@ -210,8 +210,11 @@ class WebSocketApp(object):
|
|||||||
data = data.decode("utf-8")
|
data = data.decode("utf-8")
|
||||||
self._callback(self.on_data, data, frame.opcode, True)
|
self._callback(self.on_data, data, frame.opcode, True)
|
||||||
self._callback(self.on_message, data)
|
self._callback(self.on_message, data)
|
||||||
except Exception as e:
|
except (Exception, KeyboardInterrupt, SystemExit) as e:
|
||||||
self._callback(self.on_error, e)
|
self._callback(self.on_error, e)
|
||||||
|
if isinstance(e, SystemExit):
|
||||||
|
# propagate SystemExit further
|
||||||
|
raise
|
||||||
finally:
|
finally:
|
||||||
if thread:
|
if thread:
|
||||||
event.set()
|
event.set()
|
||||||
|
Reference in New Issue
Block a user