Handle retrieving exceptions
This commit is contained in:
parent
1ee4ca8eb8
commit
8f5dcccf70
1 changed files with 6 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue