Commit 0c55d50e authored by Seblu's avatar Seblu
Browse files

better connection and auth failure message

parent 36594ed6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -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):