From d5b7d9110dd637a7f67ce9e430145314812a8df1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 26 Mar 2018 15:54:13 +0200 Subject: Fix error logging --- server/controllers/api/videos/blacklist.ts | 2 +- server/controllers/api/videos/channel.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'server/controllers/api/videos') diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index 7eee460d4..8112b59b8 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts @@ -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 } } diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts index fba5681de..e547d375f 100644 --- a/server/controllers/api/videos/channel.ts +++ b/server/controllers/api/videos/channel.ts @@ -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 -- cgit v1.2.3