disconnect the client if getting information fails

This commit is contained in:
Damien Churchill 2009-12-13 21:50:16 +00:00
parent 3c24d72489
commit b69e25e308
1 changed files with 3 additions and 2 deletions

View File

@ -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"))