Fix error log of bad import

pull/4548/head
Chocobozzz 2021-11-09 15:07:06 +01:00
parent 51353d9a03
commit d7ce63d3dd
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 7 additions and 5 deletions

View File

@ -98,12 +98,14 @@ class YoutubeDLWrapper {
})
return Promise.race([ downloadPromise, timeoutPromise ])
.catch(async err => {
const path = await this.guessVideoPathWithExtension(pathWithoutExtension, fileExt)
.catch(err => {
this.guessVideoPathWithExtension(pathWithoutExtension, fileExt)
.then(path => {
logger.debug('Error in youtube-dl import, deleting file %s.', path, { err, ...lTags() })
logger.debug('Error in youtube-dl import, deleting file %s.', path, { err, ...lTags() })
remove(path)
.catch(err => logger.error('Cannot remove file in youtubeDL timeout.', { err, ...lTags() }))
return remove(path)
})
.catch(innerErr => logger.error('Cannot remove file in youtubeDL timeout.', { innerErr, ...lTags() }))
throw err
})