Skip to content

Commit

Permalink
Handle failure to auto-save translation cleanly
Browse files Browse the repository at this point in the history
  • Loading branch information
machinewrapped committed Dec 30, 2023
1 parent bdb09bf commit a39cb11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PySubtitle/SubtitleProject.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ def SaveTranslation(self, outputpath : str = None):
Write output file
"""
include_original = self.options.get('include_original', False)
self.subtitles.SaveTranslation(outputpath, include_original=include_original)
try:
self.subtitles.SaveTranslation(outputpath, include_original=include_original)

except Exception as e:
logging.error(f"Unable to save translation: {e}")

def TranslateScene(self, scene_number, batch_numbers = None, translator : SubtitleTranslator = None):
"""
Expand Down

0 comments on commit a39cb11

Please sign in to comment.