handle missing KeePass entry
This commit is contained in:
parent
21069e892e
commit
1a9829b93b
@ -148,6 +148,8 @@ class Keepass(PasswordManager):
|
|||||||
password = getpass.getpass(f"KeePass password for database {self.database}: ")
|
password = getpass.getpass(f"KeePass password for database {self.database}: ")
|
||||||
kp = pykeepass.PyKeePass(self.database, password=password)
|
kp = pykeepass.PyKeePass(self.database, password=password)
|
||||||
entry = kp.find_entries(username=password_name, first=True)
|
entry = kp.find_entries(username=password_name, first=True)
|
||||||
|
if not entry:
|
||||||
|
raise SystemExit(f"no KeePass entry for {password_name!r} found")
|
||||||
return entry.password # type: ignore
|
return entry.password # type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user