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/models/activitypub/actor-follow.ts | 4 ++-- server/models/oauth/oauth-token.ts | 2 +- server/models/video/video.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/models') diff --git a/server/models/activitypub/actor-follow.ts b/server/models/activitypub/actor-follow.ts index d3c438626..c97f4cead 100644 --- a/server/models/activitypub/actor-follow.ts +++ b/server/models/activitypub/actor-follow.ts @@ -118,12 +118,12 @@ export class ActorFollowModel extends Model { if (goodInboxes.length !== 0) { ActorFollowModel.incrementScores(goodInboxes, ACTOR_FOLLOW_SCORE.BONUS, t) - .catch(err => logger.error('Cannot increment scores of good actor follows.', err)) + .catch(err => logger.error('Cannot increment scores of good actor follows.', { err })) } if (badInboxes.length !== 0) { ActorFollowModel.incrementScores(badInboxes, ACTOR_FOLLOW_SCORE.PENALTY, t) - .catch(err => logger.error('Cannot decrement scores of bad actor follows.', err)) + .catch(err => logger.error('Cannot decrement scores of bad actor follows.', { err })) } } diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index 528bb9587..759aa2779 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts @@ -125,7 +125,7 @@ export class OAuthTokenModel extends Model { } as OAuthTokenInfo }) .catch(err => { - logger.info('getRefreshToken error.', err) + logger.info('getRefreshToken error.', { err }) throw err }) } diff --git a/server/models/video/video.ts b/server/models/video/video.ts index f43b73e49..13bf0b6a2 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -473,7 +473,7 @@ export class VideoModel extends Model { return Promise.all(tasks) .catch(err => { - logger.error('Some errors when removing files of video %s in after destroy hook.', instance.uuid, err) + logger.error('Some errors when removing files of video %s in after destroy hook.', instance.uuid, { err }) }) } @@ -1213,7 +1213,7 @@ export class VideoModel extends Model { } catch (err) { // Auto destruction... - this.destroy().catch(err => logger.error('Cannot destruct video after transcoding failure.', err)) + this.destroy().catch(err => logger.error('Cannot destruct video after transcoding failure.', { err })) throw err } -- cgit v1.2.3