diff options
author | Chocobozzz <me@florianbigard.com> | 2018-03-26 15:54:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-03-26 16:04:14 +0200 |
commit | d5b7d9110dd637a7f67ce9e430145314812a8df1 (patch) | |
tree | d019ef5fe68b14d7e5ad11953b6c1f4811669ce6 /server/lib/activitypub | |
parent | 0dcf9a14be3f8668fe5ee65cf0365d457b4d1499 (diff) | |
download | PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.tar.gz PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.tar.zst PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.zip |
Fix error logging
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r-- | server/lib/activitypub/actor.ts | 8 | ||||
-rw-r--r-- | server/lib/activitypub/process/process-update.ts | 6 | ||||
-rw-r--r-- | server/lib/activitypub/video-comments.ts | 2 | ||||
-rw-r--r-- | server/lib/activitypub/videos.ts | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts index fa31e71c7..b0cf9bb17 100644 --- a/server/lib/activitypub/actor.ts +++ b/server/lib/activitypub/actor.ts | |||
@@ -30,7 +30,7 @@ function setAsyncActorKeys (actor: ActorModel) { | |||
30 | return actor.save() | 30 | return actor.save() |
31 | }) | 31 | }) |
32 | .catch(err => { | 32 | .catch(err => { |
33 | logger.error('Cannot set public/private keys of actor %d.', actor.uuid, err) | 33 | logger.error('Cannot set public/private keys of actor %d.', actor.uuid, { err }) |
34 | return actor | 34 | return actor |
35 | }) | 35 | }) |
36 | } | 36 | } |
@@ -117,7 +117,7 @@ async function updateActorAvatarInstance (actorInstance: ActorModel, avatarName: | |||
117 | try { | 117 | try { |
118 | await actorInstance.Avatar.destroy({ transaction: t }) | 118 | await actorInstance.Avatar.destroy({ transaction: t }) |
119 | } catch (err) { | 119 | } catch (err) { |
120 | logger.error('Cannot remove old avatar of actor %s.', actorInstance.url, err) | 120 | logger.error('Cannot remove old avatar of actor %s.', actorInstance.url, { err }) |
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
@@ -144,7 +144,7 @@ async function fetchActorTotalItems (url: string) { | |||
144 | const { body } = await doRequest(options) | 144 | const { body } = await doRequest(options) |
145 | return body.totalItems ? body.totalItems : 0 | 145 | return body.totalItems ? body.totalItems : 0 |
146 | } catch (err) { | 146 | } catch (err) { |
147 | logger.warn('Cannot fetch remote actor count %s.', url, err) | 147 | logger.warn('Cannot fetch remote actor count %s.', url, { err }) |
148 | return 0 | 148 | return 0 |
149 | } | 149 | } |
150 | } | 150 | } |
@@ -393,7 +393,7 @@ async function refreshActorIfNeeded (actor: ActorModel) { | |||
393 | return actor | 393 | return actor |
394 | }) | 394 | }) |
395 | } catch (err) { | 395 | } catch (err) { |
396 | logger.warn('Cannot refresh actor.', err) | 396 | logger.warn('Cannot refresh actor.', { err }) |
397 | return actor | 397 | return actor |
398 | } | 398 | } |
399 | } | 399 | } |
diff --git a/server/lib/activitypub/process/process-update.ts b/server/lib/activitypub/process/process-update.ts index 24e5589d4..51e3cc4e3 100644 --- a/server/lib/activitypub/process/process-update.ts +++ b/server/lib/activitypub/process/process-update.ts | |||
@@ -92,7 +92,7 @@ async function updateRemoteVideo (actor: ActorModel, activity: ActivityUpdate) { | |||
92 | 92 | ||
93 | // Don't block on request | 93 | // Don't block on request |
94 | generateThumbnailFromUrl(videoInstance, videoAttributesToUpdate.icon) | 94 | generateThumbnailFromUrl(videoInstance, videoAttributesToUpdate.icon) |
95 | .catch(err => logger.warn('Cannot generate thumbnail of %s.', videoAttributesToUpdate.id, err)) | 95 | .catch(err => logger.warn('Cannot generate thumbnail of %s.', videoAttributesToUpdate.id, { err })) |
96 | 96 | ||
97 | // Remove old video files | 97 | // Remove old video files |
98 | const videoFileDestroyTasks: Bluebird<void>[] = [] | 98 | const videoFileDestroyTasks: Bluebird<void>[] = [] |
@@ -117,7 +117,7 @@ async function updateRemoteVideo (actor: ActorModel, activity: ActivityUpdate) { | |||
117 | } | 117 | } |
118 | 118 | ||
119 | // This is just a debug because we will retry the insert | 119 | // This is just a debug because we will retry the insert |
120 | logger.debug('Cannot update the remote video.', err) | 120 | logger.debug('Cannot update the remote video.', { err }) |
121 | throw err | 121 | throw err |
122 | } | 122 | } |
123 | } | 123 | } |
@@ -176,7 +176,7 @@ async function updateRemoteActor (actor: ActorModel, activity: ActivityUpdate) { | |||
176 | } | 176 | } |
177 | 177 | ||
178 | // This is just a debug because we will retry the insert | 178 | // This is just a debug because we will retry the insert |
179 | logger.debug('Cannot update the remote account.', err) | 179 | logger.debug('Cannot update the remote account.', { err }) |
180 | throw err | 180 | throw err |
181 | } | 181 | } |
182 | } | 182 | } |
diff --git a/server/lib/activitypub/video-comments.ts b/server/lib/activitypub/video-comments.ts index b33ae27b1..8ab0cdba4 100644 --- a/server/lib/activitypub/video-comments.ts +++ b/server/lib/activitypub/video-comments.ts | |||
@@ -111,7 +111,7 @@ async function resolveThread (url: string, comments: VideoCommentModel[] = []) { | |||
111 | 111 | ||
112 | return { video, parents: comments } | 112 | return { video, parents: comments } |
113 | } catch (err) { | 113 | } catch (err) { |
114 | logger.debug('Cannot get or create account and video and channel for reply %s, fetch comment', url, err) | 114 | logger.debug('Cannot get or create account and video and channel for reply %s, fetch comment', url, { err }) |
115 | 115 | ||
116 | if (comments.length > ACTIVITY_PUB.MAX_RECURSION_COMMENTS) { | 116 | if (comments.length > ACTIVITY_PUB.MAX_RECURSION_COMMENTS) { |
117 | throw new Error('Recursion limit reached when resolving a thread') | 117 | throw new Error('Recursion limit reached when resolving a thread') |
diff --git a/server/lib/activitypub/videos.ts b/server/lib/activitypub/videos.ts index 2a6636625..ffba1570b 100644 --- a/server/lib/activitypub/videos.ts +++ b/server/lib/activitypub/videos.ts | |||
@@ -152,7 +152,7 @@ async function getOrCreateVideo (videoObject: VideoTorrentObject, channelActor: | |||
152 | 152 | ||
153 | // Don't block on request | 153 | // Don't block on request |
154 | generateThumbnailFromUrl(video, videoObject.icon) | 154 | generateThumbnailFromUrl(video, videoObject.icon) |
155 | .catch(err => logger.warn('Cannot generate thumbnail of %s.', videoObject.id, err)) | 155 | .catch(err => logger.warn('Cannot generate thumbnail of %s.', videoObject.id, { err })) |
156 | 156 | ||
157 | const videoCreated = await video.save(sequelizeOptions) | 157 | const videoCreated = await video.save(sequelizeOptions) |
158 | 158 | ||