Fix error logging

This commit is contained in:
Chocobozzz 2018-03-26 15:54:13 +02:00
parent 0dcf9a14be
commit d5b7d9110d
No known key found for this signature in database
GPG key ID: 583A612D890159BE
24 changed files with 57 additions and 41 deletions

View file

@ -64,12 +64,12 @@ async function generateImageFromVideoFile (fromPath: string, folder: string, ima
const destination = join(folder, imageName)
await processImage({ path: pendingImagePath }, destination, size)
} catch (err) {
logger.error('Cannot generate image from video %s.', fromPath, err)
logger.error('Cannot generate image from video %s.', fromPath, { err })
try {
await unlinkPromise(pendingImagePath)
} catch (err) {
logger.debug('Cannot remove pending image path after generation error.', err)
logger.debug('Cannot remove pending image path after generation error.', { err })
}
}
}