diff --git a/src/ldaptool/search/config.py b/src/ldaptool/search/config.py index 438d980..730b70b 100644 --- a/src/ldaptool/search/config.py +++ b/src/ldaptool/search/config.py @@ -148,6 +148,8 @@ class Keepass(PasswordManager): password = getpass.getpass(f"KeePass password for database {self.database}: ") kp = pykeepass.PyKeePass(self.database, password=password) 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