Index: deluge/error.py =================================================================== --- deluge/error.py (revision 2816) +++ deluge/error.py (working copy) @@ -31,6 +31,8 @@ # this exception statement from your version. If you delete this exception # statement from all source files in the program, then also delete it here. +import deluge.xmlrpclib + class DelugeError(Exception): def __init__(self, value): self.value = value @@ -40,3 +42,13 @@ class NoCoreError(DelugeError): pass +class InvalidTorrent(DelugeError): + pass + +def from_xmlrpc_fault(fault): + prefix = "deluge.error." + string = fault.faultString + string = string.replace(':', '(', 1) + ')' + if string[:len(prefix)] == prefix: + raise eval(string) + Index: deluge/ui/client.py =================================================================== --- deluge/ui/client.py (revision 2816) +++ deluge/ui/client.py (working copy) @@ -99,6 +99,8 @@ except socket.error, e: log.warning("Could not contact daemon: %s", e) self.set_core_uri(None) + except deluge.xmlrpclib.Fault, e: + deluge.error.from_xmlrpc_fault(e) finally: self._callbacks = []