Merge branch 'fix-errors-log-not-shown' into 'master'

Fix error not logged

Closes #46

See merge request framasoft/peertube/search-index!15
This commit is contained in:
Chocobozzz 2023-02-09 07:50:01 +00:00
commit ba9b101b17
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'))
})