fix the exception handling

we ♥ when exceptions create more exceptions
This commit is contained in:
boyska 2021-09-17 10:43:49 +02:00
parent c3f6423771
commit d49c7dff00

View file

@ -120,9 +120,9 @@ async def create_mp3(
for begin, start_cut, end_cut in get_files_and_intervals(start, end):
try:
file = await get_timefile(begin)
intervals.append((file, start_cut, end_cut))
except Exception as e:
logger.error(f"Error while retrieving {file}: {e}")
logger.error("Error while retrieving file: %s", e)
intervals.append((file, start_cut, end_cut))
if os.path.exists(outfile):
raise OSError("file '%s' already exists" % outfile)
for path, _s, _e in intervals: