Cdm: Return a DecodeError in set_service_certificate

This is to match with the doc-string stating it returns a DecodeError on failure.
This commit is contained in:
rlaphoenix 2022-07-20 20:55:08 +01:00
parent 2bb5c9e0b5
commit 909e83c199
1 changed files with 2 additions and 2 deletions

View File

@ -112,8 +112,8 @@ class Cdm:
signed_message = SignedMessage() signed_message = SignedMessage()
try: try:
signed_message.ParseFromString(certificate) signed_message.ParseFromString(certificate)
except DecodeError: except DecodeError as e:
raise ValueError("Could not parse certificate as a Signed Message.") raise DecodeError(f"Could not parse certificate as a Signed Message: {e}")
self.service_certificate = signed_message self.service_certificate = signed_message
return signed_message return signed_message