Skip to content

Commit 282e190

Browse files
authored
Merge pull request #397 from blacklight/396/handle-manifest-decode-errors
chore(media): Don't suppress original exception in ManifestDecodeError
2 parents 88a11fe + 542b372 commit 282e190

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tidalapi/media.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ def get_manifest_data(self) -> str:
609609
try:
610610
# Stream Manifest is base64 encoded.
611611
return base64.b64decode(self.manifest).decode("utf-8")
612-
except:
613-
raise ManifestDecodeError
612+
except Exception as e:
613+
raise ManifestDecodeError from e
614614

615615
@property
616616
def is_mpd(self) -> bool:
@@ -761,15 +761,15 @@ def from_stream(stream) -> "DashInfo":
761761
try:
762762
if stream.is_mpd and not stream.is_encrypted:
763763
return DashInfo(stream.get_manifest_data())
764-
except:
765-
raise ManifestDecodeError
764+
except Exception as e:
765+
raise ManifestDecodeError from e
766766

767767
@staticmethod
768768
def from_mpd(mpd_manifest) -> "DashInfo":
769769
try:
770770
return DashInfo(mpd_manifest)
771-
except:
772-
raise ManifestDecodeError
771+
except Exception as e:
772+
raise ManifestDecodeError from e
773773

774774
def __init__(self, mpd_xml):
775775
mpd = MPEGDASHParser.parse(

0 commit comments

Comments
 (0)