Fix error not logged

This commit is contained in:
Florent 2023-02-08 09:50:20 +01:00 committed by Florent F
parent adfe422cc1
commit ef7b929a72
1 changed files with 3 additions and 3 deletions

View File

@ -134,7 +134,7 @@ app.use(function (err, req, res, next) {
error = err.stack || err.message || err
}
logger.error({ error }, 'Error in controller.')
logger.error({ err: error }, 'Error in controller.')
return res.status(err.status || 500).end()
})
@ -148,10 +148,10 @@ app.listen(CONFIG.LISTEN.PORT, async () => {
try {
await IndexationScheduler.Instance.initIndexes()
} catch (err) {
logger.error('Cannot init videos index.', { err })
logger.error(err, 'Cannot init videos index.')
process.exit(-1)
}
IndexationScheduler.Instance.execute()
.catch(err => logger.error('Cannot run video indexer', { err }))
.catch(err => logger.error(err, 'Cannot run video indexer'))
})