From 0c55d50e2d05ef51b0c7dd76743ffbe639d43a4e Mon Sep 17 00:00:00 2001 From: Seblu Date: Mon, 3 Jan 2011 12:55:42 +0100 Subject: [PATCH] better connection and auth failure message --- cccli/cli.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cccli/cli.py b/cccli/cli.py index 68ca4f1..6899160 100644 --- a/cccli/cli.py +++ b/cccli/cli.py @@ -68,8 +68,9 @@ class Cli(object): ) rpcc.start(daemonize=True) self.rpc = ConnectionProxy(rpcc) - except Exception: - raise cliError("Connection failure!") + except Exception as e: + s = "Connection failure!" if not str(e) else "Connection failure: %s"%str(e) + raise cliError(s) self.printer.debug("Connected.") def _auth(self): @@ -77,8 +78,9 @@ class Cli(object): self.printer.debug("Authenticating...") try: self.rpc.authentify(self.settings["login"], self.settings["pass"]) - except Exception: - raise cliError("Autentification failed!") + except Exception as e: + s = "Authentication failure!" if not str(e) else "Authentication failure: %s"%str(e) + raise cliError(s) self.printer.debug("Authenticated.") def _parse(self): -- GitLab