diff options
author | Damien Churchill <damoc@gmail.com> | 2009-12-13 21:50:16 +0000 |
---|---|---|
committer | Damien Churchill <damoc@gmail.com> | 2009-12-13 21:50:16 +0000 |
commit | 3f69b05deda1aa58c2d7d958a067d603e06f8c21 (patch) | |
tree | 0b5a32f85cf51cb67dac547ddce219635523f42c | |
parent | ecca68772ee5b8f596e87337fb339306937b312f (diff) | |
download | deluge-3f69b05deda1aa58c2d7d958a067d603e06f8c21.tar.gz deluge-3f69b05deda1aa58c2d7d958a067d603e06f8c21.tar.bz2 deluge-3f69b05deda1aa58c2d7d958a067d603e06f8c21.zip |
disconnect the client if getting information fails
-rw-r--r-- | deluge/ui/web/json_api.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py index 5858e1c50..736c8c43b 100644 --- a/deluge/ui/web/json_api.py +++ b/deluge/ui/web/json_api.py @@ -668,7 +668,8 @@ class WebApi(JSONComponent): c.disconnect() callback(_("Online"), info) - def on_info_fail(reason): + def on_info_fail(reason, c): + c.disconnect() callback(_("Offline")) if not connected: @@ -677,7 +678,7 @@ class WebApi(JSONComponent): d = c.daemon.info() d.addCallback(on_info, c) - d.addErrback(on_info_fail) + d.addErrback(on_info_fail, c) def on_connect_failed(reason, host_id): callback(_("Offline")) |