Skip to content
Snippets Groups Projects
Commit 0c55d50e authored by Seblu's avatar Seblu
Browse files

better connection and auth failure message

parent 36594ed6
No related branches found
No related tags found
No related merge requests found
...@@ -68,8 +68,9 @@ class Cli(object): ...@@ -68,8 +68,9 @@ class Cli(object):
) )
rpcc.start(daemonize=True) rpcc.start(daemonize=True)
self.rpc = ConnectionProxy(rpcc) self.rpc = ConnectionProxy(rpcc)
except Exception: except Exception as e:
raise cliError("Connection failure!") s = "Connection failure!" if not str(e) else "Connection failure: %s"%str(e)
raise cliError(s)
self.printer.debug("Connected.") self.printer.debug("Connected.")
def _auth(self): def _auth(self):
...@@ -77,8 +78,9 @@ class Cli(object): ...@@ -77,8 +78,9 @@ class Cli(object):
self.printer.debug("Authenticating...") self.printer.debug("Authenticating...")
try: try:
self.rpc.authentify(self.settings["login"], self.settings["pass"]) self.rpc.authentify(self.settings["login"], self.settings["pass"])
except Exception: except Exception as e:
raise cliError("Autentification failed!") s = "Authentication failure!" if not str(e) else "Authentication failure: %s"%str(e)
raise cliError(s)
self.printer.debug("Authenticated.") self.printer.debug("Authenticated.")
def _parse(self): def _parse(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment