From 987eee2b0f79a6c2ae5dba1d0293338567478ab8 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sat, 10 Sep 2022 21:19:27 +0100 Subject: [PATCH] Cdm: More clearly represent a DecodeError in set_service_cert --- pywidevine/cdm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pywidevine/cdm.py b/pywidevine/cdm.py index 7c6696e..84e812c 100644 --- a/pywidevine/cdm.py +++ b/pywidevine/cdm.py @@ -208,14 +208,14 @@ class Cdm: else: signed_drm_certificate.ParseFromString(certificate) if signed_drm_certificate.SerializeToString() != certificate: - raise DecodeError() + raise DecodeError("partial parse") # Craft a SignedMessage as it's stored as a SignedMessage signed_message.Clear() signed_message.msg = signed_drm_certificate.SerializeToString() # we don't need to sign this message, this is normal - except DecodeError: + except DecodeError as e: # could be a direct unsigned DrmCertificate, but reject those anyway - raise DecodeError("Could not parse certificate as a SignedDrmCertificate") + raise DecodeError(f"Could not parse certificate as a SignedDrmCertificate, {e}") try: pss. \