diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-07 18:26:12 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-07 18:26:12 +0200 |
commit | ad0997adfb9e1e3b1ff54338d7558cf7b18440ea (patch) | |
tree | 78ef53699d260e194bbcda7eccb645a14070679a /server/controllers/api/remote | |
parent | 709756b8e183f67ef9bf8f7bc149af4736260350 (diff) | |
download | PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.tar.gz PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.tar.zst PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.zip |
Fix error logging
Diffstat (limited to 'server/controllers/api/remote')
-rw-r--r-- | server/controllers/api/remote/videos.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/server/controllers/api/remote/videos.ts b/server/controllers/api/remote/videos.ts index eb033637e..fac85c3a8 100644 --- a/server/controllers/api/remote/videos.ts +++ b/server/controllers/api/remote/videos.ts | |||
@@ -76,7 +76,7 @@ function remoteVideos (req: express.Request, res: express.Response, next: expres | |||
76 | 76 | ||
77 | return fun.call(this, data, fromPod) | 77 | return fun.call(this, data, fromPod) |
78 | }) | 78 | }) |
79 | .catch(err => logger.error('Error managing remote videos.', { error: err })) | 79 | .catch(err => logger.error('Error managing remote videos.', err)) |
80 | 80 | ||
81 | // Don't block the other pod | 81 | // Don't block the other pod |
82 | return res.type('json').status(204).end() | 82 | return res.type('json').status(204).end() |
@@ -91,7 +91,7 @@ function remoteVideosQadu (req: express.Request, res: express.Response, next: ex | |||
91 | 91 | ||
92 | return quickAndDirtyUpdateVideoRetryWrapper(videoData, fromPod) | 92 | return quickAndDirtyUpdateVideoRetryWrapper(videoData, fromPod) |
93 | }) | 93 | }) |
94 | .catch(err => logger.error('Error managing remote videos.', { error: err })) | 94 | .catch(err => logger.error('Error managing remote videos.', err)) |
95 | 95 | ||
96 | return res.type('json').status(204).end() | 96 | return res.type('json').status(204).end() |
97 | } | 97 | } |
@@ -105,7 +105,7 @@ function remoteVideosEvents (req: express.Request, res: express.Response, next: | |||
105 | 105 | ||
106 | return processVideosEventsRetryWrapper(eventData, fromPod) | 106 | return processVideosEventsRetryWrapper(eventData, fromPod) |
107 | }) | 107 | }) |
108 | .catch(err => logger.error('Error managing remote videos.', { error: err })) | 108 | .catch(err => logger.error('Error managing remote videos.', err)) |
109 | 109 | ||
110 | return res.type('json').status(204).end() | 110 | return res.type('json').status(204).end() |
111 | } | 111 | } |
@@ -167,7 +167,7 @@ function processVideosEvents (eventData: any, fromPod: PodInstance) { | |||
167 | }) | 167 | }) |
168 | .then(() => logger.info('Remote video event processed for video %s.', eventData.remoteId)) | 168 | .then(() => logger.info('Remote video event processed for video %s.', eventData.remoteId)) |
169 | .catch(err => { | 169 | .catch(err => { |
170 | logger.debug('Cannot process a video event.', { error: err }) | 170 | logger.debug('Cannot process a video event.', err) |
171 | throw err | 171 | throw err |
172 | }) | 172 | }) |
173 | } | 173 | } |
@@ -207,7 +207,7 @@ function quickAndDirtyUpdateVideo (videoData: any, fromPod: PodInstance) { | |||
207 | }) | 207 | }) |
208 | }) | 208 | }) |
209 | .then(() => logger.info('Remote video %s quick and dirty updated', videoName)) | 209 | .then(() => logger.info('Remote video %s quick and dirty updated', videoName)) |
210 | .catch(err => logger.debug('Cannot quick and dirty update the remote video.', { error: err })) | 210 | .catch(err => logger.debug('Cannot quick and dirty update the remote video.', err)) |
211 | } | 211 | } |
212 | 212 | ||
213 | // Handle retries on fail | 213 | // Handle retries on fail |
@@ -287,7 +287,7 @@ function addRemoteVideo (videoToCreateData: any, fromPod: PodInstance) { | |||
287 | }) | 287 | }) |
288 | .then(() => logger.info('Remote video %s inserted.', videoToCreateData.name)) | 288 | .then(() => logger.info('Remote video %s inserted.', videoToCreateData.name)) |
289 | .catch(err => { | 289 | .catch(err => { |
290 | logger.debug('Cannot insert the remote video.', { error: err }) | 290 | logger.debug('Cannot insert the remote video.', err) |
291 | throw err | 291 | throw err |
292 | }) | 292 | }) |
293 | } | 293 | } |
@@ -341,7 +341,7 @@ function updateRemoteVideo (videoAttributesToUpdate: any, fromPod: PodInstance) | |||
341 | .then(() => logger.info('Remote video %s updated', videoAttributesToUpdate.name)) | 341 | .then(() => logger.info('Remote video %s updated', videoAttributesToUpdate.name)) |
342 | .catch(err => { | 342 | .catch(err => { |
343 | // This is just a debug because we will retry the insert | 343 | // This is just a debug because we will retry the insert |
344 | logger.debug('Cannot update the remote video.', { error: err }) | 344 | logger.debug('Cannot update the remote video.', err) |
345 | throw err | 345 | throw err |
346 | }) | 346 | }) |
347 | } | 347 | } |
@@ -354,7 +354,7 @@ function removeRemoteVideo (videoToRemoveData: any, fromPod: PodInstance) { | |||
354 | return video.destroy() | 354 | return video.destroy() |
355 | }) | 355 | }) |
356 | .catch(err => { | 356 | .catch(err => { |
357 | logger.debug('Could not fetch remote video.', { host: fromPod.host, remoteId: videoToRemoveData.remoteId, error: err }) | 357 | logger.debug('Could not fetch remote video.', { host: fromPod.host, remoteId: videoToRemoveData.remoteId, error: err.stack }) |
358 | }) | 358 | }) |
359 | } | 359 | } |
360 | 360 | ||
@@ -372,7 +372,7 @@ function reportAbuseRemoteVideo (reportData: any, fromPod: PodInstance) { | |||
372 | 372 | ||
373 | return db.VideoAbuse.create(videoAbuseData) | 373 | return db.VideoAbuse.create(videoAbuseData) |
374 | }) | 374 | }) |
375 | .catch(err => logger.error('Cannot create remote abuse video.', { error: err })) | 375 | .catch(err => logger.error('Cannot create remote abuse video.', err)) |
376 | } | 376 | } |
377 | 377 | ||
378 | function fetchOwnedVideo (id: string) { | 378 | function fetchOwnedVideo (id: string) { |
@@ -383,7 +383,7 @@ function fetchOwnedVideo (id: string) { | |||
383 | return video | 383 | return video |
384 | }) | 384 | }) |
385 | .catch(err => { | 385 | .catch(err => { |
386 | logger.error('Cannot load owned video from id.', { error: err, id }) | 386 | logger.error('Cannot load owned video from id.', { error: err.stack, id }) |
387 | throw err | 387 | throw err |
388 | }) | 388 | }) |
389 | } | 389 | } |
@@ -396,7 +396,7 @@ function fetchRemoteVideo (podHost: string, remoteId: string) { | |||
396 | return video | 396 | return video |
397 | }) | 397 | }) |
398 | .catch(err => { | 398 | .catch(err => { |
399 | logger.error('Cannot load video from host and remote id.', { error: err, podHost, remoteId }) | 399 | logger.error('Cannot load video from host and remote id.', { error: err.stack, podHost, remoteId }) |
400 | throw err | 400 | throw err |
401 | }) | 401 | }) |
402 | } | 402 | } |