Clarify missing file error (#384)

This commit is contained in:
Leonardo Mariga
2023-06-25 11:44:37 -03:00
committed by GitHub
parent a41ad7b104
commit 1c8c1f5bb5

View File

@@ -18,7 +18,7 @@ class DB:
full_path = self.path / key
if not full_path.is_file():
raise KeyError(key)
raise KeyError(f"File '{key}' could not be found in '{self.path}'")
with full_path.open("r", encoding="utf-8") as f:
return f.read()