Raise error on connection lost.

This commit is contained in:
Joey Payne 2016-02-01 16:29:57 -07:00
commit 2c1e2ed373

View file

@ -237,7 +237,7 @@ class SocketIO(object):
callback, args = find_callback(args, kw)
self._transport.emit(path, event, args, callback)
def wait(self, seconds=None, for_callbacks=False):
def wait(self, seconds=None, for_callbacks=False, raise_error=False):
"""Wait in a loop and process events as defined in the namespaces.
- Omit seconds, i.e. call wait() without arguments, to wait forever.
@ -254,6 +254,8 @@ class SocketIO(object):
pass
next(self._heartbeat_pacemaker)
except ConnectionError as e:
if raise_error:
raise
try:
warning = Exception('[connection error] %s' % e)
warning_screen.throw(warning)