From 542b372c07db121f0cd4a3f8754bfd9d330bec94 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 15 Jan 2026 20:35:02 +0100 Subject: [PATCH] chore(media): Don't suppress original exception in ManifestDecodeError The purpose of this commit is to improve error handling when decoding the manifest in the tidalapi library. Instead of suppressing the original exception when a manifest decoding error occurs, it now chains the original exception to the ManifestDecodeError. Reference: #396 --- tidalapi/media.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tidalapi/media.py b/tidalapi/media.py index 8cb4d2c..e04d382 100644 --- a/tidalapi/media.py +++ b/tidalapi/media.py @@ -609,8 +609,8 @@ def get_manifest_data(self) -> str: try: # Stream Manifest is base64 encoded. return base64.b64decode(self.manifest).decode("utf-8") - except: - raise ManifestDecodeError + except Exception as e: + raise ManifestDecodeError from e @property def is_mpd(self) -> bool: @@ -761,15 +761,15 @@ def from_stream(stream) -> "DashInfo": try: if stream.is_mpd and not stream.is_encrypted: return DashInfo(stream.get_manifest_data()) - except: - raise ManifestDecodeError + except Exception as e: + raise ManifestDecodeError from e @staticmethod def from_mpd(mpd_manifest) -> "DashInfo": try: return DashInfo(mpd_manifest) - except: - raise ManifestDecodeError + except Exception as e: + raise ManifestDecodeError from e def __init__(self, mpd_xml): mpd = MPEGDASHParser.parse(