Commit fa97d54e authored by neodarz's avatar neodarz
Browse files

Handling ValueError exception when login command

parent 5c5b0e2e
Pipeline #4207 passed with stage
in 29 seconds
......@@ -206,7 +206,12 @@ async def login(ctx, username, password):
session, ctx.obj["SERVER_URL"], username=username, password=password
)
keyring.set_password(ctx.obj["SERVER_URL"], "_", token)
try:
keyring.set_password(ctx.obj["SERVER_URL"], "_", token)
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]))
click.echo("Login successfull!")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment