From ad0997adfb9e1e3b1ff54338d7558cf7b18440ea Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Jul 2017 18:26:12 +0200 Subject: Fix error logging --- server/models/oauth/oauth-token.ts | 2 +- server/models/pod/pod.ts | 6 +++--- server/models/video/video.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'server/models') diff --git a/server/models/oauth/oauth-token.ts b/server/models/oauth/oauth-token.ts index 8c6883465..a0a13aab7 100644 --- a/server/models/oauth/oauth-token.ts +++ b/server/models/oauth/oauth-token.ts @@ -114,7 +114,7 @@ getByRefreshTokenAndPopulateClient = function (refreshToken: string) { return tokenInfos }).catch(function (err) { - logger.info('getRefreshToken error.', { error: err }) + logger.info('getRefreshToken error.', err) }) } diff --git a/server/models/pod/pod.ts b/server/models/pod/pod.ts index 9209380fc..62d9e3c6c 100644 --- a/server/models/pod/pod.ts +++ b/server/models/pod/pod.ts @@ -216,7 +216,7 @@ updatePodsScore = function (goodPods: number[], badPods: number[]) { if (goodPods.length !== 0) { incrementScores(goodPods, PODS_SCORE.BONUS).catch(err => { - logger.error('Cannot increment scores of good pods.', { error: err }) + logger.error('Cannot increment scores of good pods.', err) }) } @@ -224,7 +224,7 @@ updatePodsScore = function (goodPods: number[], badPods: number[]) { incrementScores(badPods, PODS_SCORE.MALUS) .then(() => removeBadPods()) .catch(err => { - if (err) logger.error('Cannot decrement scores of bad pods.', { error: err }) + if (err) logger.error('Cannot decrement scores of bad pods.', err) }) } } @@ -246,6 +246,6 @@ function removeBadPods () { } }) .catch(err => { - logger.error('Cannot remove bad pods.', { error: err }) + logger.error('Cannot remove bad pods.', err) }) } diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 3d71e8d9e..47d3cad1d 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -553,7 +553,7 @@ transcodeVideofile = function (this: VideoInstance) { .catch(err => { // Autodesctruction... video.destroy().asCallback(function (err) { - if (err) logger.error('Cannot destruct video after transcoding failure.', { error: err }) + if (err) logger.error('Cannot destruct video after transcoding failure.', err) }) return rej(err) -- cgit v1.2.3