Commit 58ae4ea3 authored by Agate's avatar Agate 💬

Merge branch 'cryptfile_exception_handling_login' into 'master'

Handling ValueError exception when login command

Closes #8

See merge request !7
parents 5c5b0e2e fa97d54e
Pipeline #4359 passed with stages
in 3 minutes and 11 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!")
......
Markdown is supported
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