if download fails, don't try to run ffmpeg at all

error handling is still not complete: the job is still considered to be
"in progress"
This commit is contained in:
boyska 2021-09-17 11:42:56 +02:00
parent fda08d7d0d
commit 40394331ef

View file

@ -121,11 +121,10 @@ async def create_mp3(
intervals = []
for begin, start_cut, end_cut in get_files_and_intervals(start, end):
try:
file = await get_timefile(begin)
filename = await get_timefile(begin)
except Exception as e:
logger.error("Error while retrieving file: %s", e)
else:
intervals.append((file, start_cut, end_cut))
raise ValueError("Error while retrieving file: %s" % e) from e
intervals.append((filename, start_cut, end_cut))
if os.path.exists(outfile):
raise OSError("file '%s' already exists" % outfile)
for path, _s, _e in intervals: