Skip to content

Commit

Permalink
feat: raise MissingEntryError for missing credential (WebOfTrust#841)
Browse files Browse the repository at this point in the history
  • Loading branch information
iFergal authored Aug 12, 2024
1 parent cde9a74 commit 388e392
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/keri/vdr/viring.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ def cloneCred(self, said):
"""

creder = self.creds.get(keys=(said,))
if creder is None:
raise kering.MissingEntryError(f"no credential found with said {said}")
prefixer, seqner, saider = self.cancs.get(keys=(said,))
return creder, prefixer, seqner, saider

Expand Down
3 changes: 3 additions & 0 deletions tests/vdr/test_verifying.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ def test_verifier(seeder):
for idx, cred in enumerate(creds):
assert dcre.sad == cred["sad"]

with pytest.raises(kering.MissingEntryError):
regery.reger.cloneCred(said="nonexistantsaid")

"""End Test"""


Expand Down

0 comments on commit 388e392

Please sign in to comment.