Skip to content
Snippets Groups Projects
Commit 58ae4ea3 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'cryptfile_exception_handling_login' into 'master'

Handling ValueError exception when login command

Closes #8

See merge request !7
parents 5c5b0e2e fa97d54e
No related branches found
No related tags found
1 merge request!7Handling ValueError exception when login command
Pipeline #4359 passed
......@@ -206,7 +206,12 @@ async def login(ctx, username, password):
session, ctx.obj["SERVER_URL"], username=username, password=password
)
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!")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment