Mercurial > libervia-web
changeset 642:5af02673d047 frontends_multi_profiles
browser side (json): replaced the Window.alert by a log warning when signal is lost
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 24 Feb 2015 19:15:07 +0100 |
parents | f5145881723a |
children | 3e4826948eef |
files | src/browser/sat_browser/json.py |
diffstat | 1 files changed, 2 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/browser/sat_browser/json.py Tue Feb 24 18:21:33 2015 +0100 +++ b/src/browser/sat_browser/json.py Tue Feb 24 19:15:07 2015 +0100 @@ -223,7 +223,7 @@ def onRemoteError(self, code, errobj, request_info): if errobj['message'] == 'Empty Response': - Window.alert (u"Empty reponse bridgeSignal\ncode={}\nrequest_info: id={} method={} handler={}".format(code, request_info.id, request_info.method, request_info.handler)) + log.warning(u"Empty reponse bridgeSignal\ncode={}\nrequest_info: id={} method={} handler={}".format(code, request_info.id, request_info.method, request_info.handler)) # FIXME: to check/replace by a proper session end on disconnected signal # Window.getLocation().reload() # XXX: reset page in case of session ended. # FIXME: Should be done more properly without hard reload @@ -235,6 +235,7 @@ def _timerCb(timer): log.info("Trying to reconnect to server...") self.getSignals(callback=self.signalHandler) + # TODO: display a notification to user log.warning("Lost connection, trying to reconnect in {} s".format(self.retry_delay/1000)) Timer(notify=_timerCb).schedule(self.retry_delay) self.retry_delay *= 2