Handle retrieving exceptions

This commit is contained in:
Blallo 2021-09-17 10:21:21 +02:00
parent 1ee4ca8eb8
commit 8f5dcccf70
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -1,3 +1,4 @@
import aiohttp
import asyncio
import logging
import tempfile
@ -117,8 +118,11 @@ async def create_mp3(
intervals = []
for begin, start_cut, end_cut in get_files_and_intervals(start, end):
file = await get_timefile(begin)
intervals.append((file, start_cut, end_cut))
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}")
if os.path.exists(outfile):
raise OSError("file '%s' already exists" % outfile)
for path, _s, _e in intervals: