Don't absorb error messages on Caption Syntax Errors

This commit is contained in:
rlaphoenix 2023-03-17 18:56:53 +00:00
parent 2a4dfb3e93
commit 41018d4574
1 changed files with 2 additions and 2 deletions

View File

@ -178,8 +178,8 @@ class Subtitle(Track):
replace("\n\n<", "\n<")
captions: pycaption.CaptionSet = pycaption.WebVTTReader().read(text)
return captions
except pycaption.exceptions.CaptionReadSyntaxError:
raise SyntaxError(f"A syntax error has occurred when reading the \"{codec}\" subtitle")
except pycaption.exceptions.CaptionReadSyntaxError as e:
raise SyntaxError(f"A syntax error has occurred when reading the \"{codec}\" subtitle: {e}")
except pycaption.exceptions.CaptionReadNoCaptions:
return pycaption.CaptionSet({"en": []})