From 76da1ac525b1a1ef012293cb60dbaa501e5cc8f7 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Sun, 10 Feb 2008 14:12:14 +0000 Subject: [PATCH] Show an error message when trying to do an operation while disconnected from a deluge daemon. --- deluge/ui/null/deluge_shell.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/deluge/ui/null/deluge_shell.py b/deluge/ui/null/deluge_shell.py index 1e2e09199..4794c6559 100755 --- a/deluge/ui/null/deluge_shell.py +++ b/deluge/ui/null/deluge_shell.py @@ -25,6 +25,7 @@ deluge-shell: Deluge shell. import deluge.ui.client as client import deluge.common as common +import deluge.error import readline import logging @@ -338,7 +339,13 @@ class NullUI: commands['help'].execute([]) else: command = commands[cmd] - command.execute(inp) - client.force_call() + try: + command.execute(inp) + client.force_call() + except deluge.error.NoCoreError, e: + print "*** Operation failed. You are not connected to a deluge daemon." + print " Perhaps you want to 'connect' first." + print "" print "Thanks." +