diff --git a/funkwhale_cli/cli.py b/funkwhale_cli/cli.py index f772cd0d1bf159e68cf8e3a755029f42f97aeca3..6d58b9864a5c6c2adff04932d2c4d0d066edb267 100644 --- a/funkwhale_cli/cli.py +++ b/funkwhale_cli/cli.py @@ -95,7 +95,12 @@ def set_server(ctx, url, token): parsed = urllib.parse.urlparse(url) ctx.obj["SERVER_NETLOC"] = parsed.netloc ctx.obj["SERVER_PROTOCOL"] = parsed.scheme - token = token or keyring.get_password(url, "_") + try: + token = token or keyring.get_password(url, "_") + except ValueError as e: + raise click.ClickException("Error while retrieving password from keyring: {}. Your password may be incorrect.".format(e.args[0])) + except Exception as e: + raise click.ClickException("Error while retrieving password from keyring: {}".format(e.args[0])) ctx.obj["remote"] = api.get_api( domain=ctx.obj["SERVER_NETLOC"], protocol=ctx.obj["SERVER_PROTOCOL"],