From 2e7bd90bda309f41863822adf541a4f445da8edc Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sat, 9 Jul 2011 00:56:48 +0100 Subject: [PATCH] Fix #1801: ConsoleUI failed connect results in unhandled defered error and missing error message --- deluge/ui/console/commands/connect.py | 6 +++++- deluge/ui/console/main.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/commands/connect.py b/deluge/ui/console/commands/connect.py index 010f6a749..18401f3fc 100644 --- a/deluge/ui/console/commands/connect.py +++ b/deluge/ui/console/commands/connect.py @@ -59,7 +59,11 @@ class Command(BaseCommand): component.start() def on_connect_fail(result): - self.console.write("{!error!}Failed to connect to %s:%s with reason: %s" % (host, port, result.value.args[0])) + try: + msg = result.value.exception_msg + except: + msg = result.value.args[0] + self.console.write("{!error!}Failed to connect to %s:%s with reason: %s" % (host, port, msg)) d.addCallback(on_connect) d.addErrback(on_connect_fail) diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py index b6601e16e..dff119c3f 100644 --- a/deluge/ui/console/main.py +++ b/deluge/ui/console/main.py @@ -184,8 +184,11 @@ class ConsoleUI(component.Component): self.started_deferred.addCallback(on_started) component.start().addCallback(on_started) + def on_connect_fail(result): + pass d = client.connect() d.addCallback(on_connect) + d.addErrback(on_connect_fail) self.coreconfig = CoreConfig() if self.interactive and not deluge.common.windows_check():