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