1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

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

@ -93,14 +93,14 @@ async function followRetry (req: express.Request, res: express.Response, next: e
return retryTransactionWrapper(follow, options)
})
.catch(err => logger.warn('Cannot follow server %s.', sanitizedHost, err))
.catch(err => logger.warn('Cannot follow server %s.', sanitizedHost, { err }))
tasks.push(p)
}
// Don't make the client wait the tasks
Promise.all(tasks)
.catch(err => logger.error('Error in follow.', err))
.catch(err => logger.error('Error in follow.', { err }))
return res.status(204).end()
}
@ -144,7 +144,7 @@ async function removeFollow (req: express.Request, res: express.Response, next:
// This could be long so don't wait this task
const following = follow.ActorFollowing
following.destroy()
.catch(err => logger.error('Cannot destroy actor that we do not follow anymore %s.', following.url, err))
.catch(err => logger.error('Cannot destroy actor that we do not follow anymore %s.', following.url, { err }))
return res.status(204).end()
}

View file

@ -69,7 +69,7 @@ async function removeVideoFromBlacklistController (req: express.Request, res: ex
return res.sendStatus(204)
} catch (err) {
logger.error('Some error while removing video %s from blacklist.', res.locals.video.uuid, err)
logger.error('Some error while removing video %s from blacklist.', res.locals.video.uuid, { err })
throw err
}
}

View file

@ -98,7 +98,7 @@ async function addVideoChannel (req: express.Request, res: express.Response) {
})
setAsyncActorKeys(videoChannelCreated.Actor)
.catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, err))
.catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, { err }))
logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid)
@ -137,7 +137,7 @@ async function updateVideoChannel (req: express.Request, res: express.Response)
logger.info('Video channel with name %s and uuid %s updated.', videoChannelInstance.name, videoChannelInstance.Actor.uuid)
} catch (err) {
logger.debug('Cannot update the video channel.', err)
logger.debug('Cannot update the video channel.', { err })
// Force fields we want to update
// If the transaction is retried, sequelize will think the object has not changed