Skip to content

Commit 956e410

Browse files
author
Athan Massouras
committed
fix: fix error messages
Signed-off-by: Athan Massouras <athan@indicio.tech>
1 parent 1df4254 commit 956e410

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bitstring_status_list/verifier.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ async def retrieve_list(
8080

8181
headers = headers or {}
8282

83+
if not all(key in credential_status.keys() for key in ["id", "type", "statusPurpose", "statusListIndex", "statusListCredential"]):
84+
raise StatusVerificationError(f"Invalid credential_status: {credential_status}. \
85+
credential status is expected to have keys: \
86+
[id, type, statusPurpose, statusListIndex, statusListCredential]")
87+
8388
async with ClientSession() as session:
8489
async with session.get(credential_status["statusListCredential"], headers=headers) as resp:
8590
if not 200 <= resp.status < 300:
@@ -220,7 +225,7 @@ def get_status(self, idx: Optional[int] = None):
220225
return return_dict
221226

222227
except KeyError as k:
223-
raise StatusVerificationError(f"statusMessage is malformed or not present: {k}")
228+
raise StatusVerificationError("statusMessage is malformed or not present") from k
224229

225230
raise StatusVerificationError(f"Status {status} not found in message list: {self.credential_status["statusMessage"]}")
226231

0 commit comments

Comments
 (0)