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/videos | |
parent | 709756b8e183f67ef9bf8f7bc149af4736260350 (diff) | |
download | PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.tar.gz PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.tar.zst PeerTube-ad0997adfb9e1e3b1ff54338d7558cf7b18440ea.zip |
Fix error logging
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/abuse.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/blacklist.ts | 2 | ||||
-rw-r--r-- | server/controllers/api/videos/index.ts | 8 | ||||
-rw-r--r-- | server/controllers/api/videos/rate.ts | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/api/videos/abuse.ts b/server/controllers/api/videos/abuse.ts index fcbd5465f..3b1b7f58e 100644 --- a/server/controllers/api/videos/abuse.ts +++ b/server/controllers/api/videos/abuse.ts | |||
@@ -90,7 +90,7 @@ function reportVideoAbuse (req: express.Request, res: express.Response) { | |||
90 | }) | 90 | }) |
91 | .then((videoInstance: VideoInstance) => logger.info('Abuse report for video %s created.', videoInstance.name)) | 91 | .then((videoInstance: VideoInstance) => logger.info('Abuse report for video %s created.', videoInstance.name)) |
92 | .catch(err => { | 92 | .catch(err => { |
93 | logger.debug('Cannot update the video.', { error: err }) | 93 | logger.debug('Cannot update the video.', err) |
94 | throw err | 94 | throw err |
95 | }) | 95 | }) |
96 | } | 96 | } |
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts index e4be6f0f9..d8f2068ec 100644 --- a/server/controllers/api/videos/blacklist.ts +++ b/server/controllers/api/videos/blacklist.ts | |||
@@ -35,7 +35,7 @@ function addVideoToBlacklist (req: express.Request, res: express.Response, next: | |||
35 | db.BlacklistedVideo.create(toCreate) | 35 | db.BlacklistedVideo.create(toCreate) |
36 | .then(() => res.type('json').status(204).end()) | 36 | .then(() => res.type('json').status(204).end()) |
37 | .catch(err => { | 37 | .catch(err => { |
38 | logger.error('Errors when blacklisting video ', { error: err }) | 38 | logger.error('Errors when blacklisting video ', err) |
39 | return next(err) | 39 | return next(err) |
40 | }) | 40 | }) |
41 | } | 41 | } |
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index ed1f21d66..3532c753e 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -63,7 +63,7 @@ const storage = multer.diskStorage({ | |||
63 | cb(null, filename + '.' + extension) | 63 | cb(null, filename + '.' + extension) |
64 | }) | 64 | }) |
65 | .catch(err => { | 65 | .catch(err => { |
66 | logger.error('Cannot generate random string for file name.', { error: err }) | 66 | logger.error('Cannot generate random string for file name.', err) |
67 | throw err | 67 | throw err |
68 | }) | 68 | }) |
69 | } | 69 | } |
@@ -304,7 +304,7 @@ function updateVideo (req: express.Request, res: express.Response) { | |||
304 | logger.info('Video with name %s updated.', videoInstance.name) | 304 | logger.info('Video with name %s updated.', videoInstance.name) |
305 | }) | 305 | }) |
306 | .catch(err => { | 306 | .catch(err => { |
307 | logger.debug('Cannot update the video.', { error: err }) | 307 | logger.debug('Cannot update the video.', err) |
308 | 308 | ||
309 | // Force fields we want to update | 309 | // Force fields we want to update |
310 | // If the transaction is retried, sequelize will think the object has not changed | 310 | // If the transaction is retried, sequelize will think the object has not changed |
@@ -333,7 +333,7 @@ function getVideo (req: express.Request, res: express.Response, next: express.Ne | |||
333 | } | 333 | } |
334 | return quickAndDirtyUpdateVideoToFriends(qaduParams) | 334 | return quickAndDirtyUpdateVideoToFriends(qaduParams) |
335 | }) | 335 | }) |
336 | .catch(err => logger.error('Cannot add view to video %d.', videoInstance.id, { error: err })) | 336 | .catch(err => logger.error('Cannot add view to video %d.', videoInstance.id, err)) |
337 | } else { | 337 | } else { |
338 | // Just send the event to our friends | 338 | // Just send the event to our friends |
339 | const eventParams = { | 339 | const eventParams = { |
@@ -359,7 +359,7 @@ function removeVideo (req: express.Request, res: express.Response, next: express | |||
359 | videoInstance.destroy() | 359 | videoInstance.destroy() |
360 | .then(() => res.type('json').status(204).end()) | 360 | .then(() => res.type('json').status(204).end()) |
361 | .catch(err => { | 361 | .catch(err => { |
362 | logger.error('Errors when removed the video.', { error: err }) | 362 | logger.error('Errors when removed the video.', err) |
363 | return next(err) | 363 | return next(err) |
364 | }) | 364 | }) |
365 | } | 365 | } |
diff --git a/server/controllers/api/videos/rate.ts b/server/controllers/api/videos/rate.ts index 3d119d98b..dfb5a450f 100644 --- a/server/controllers/api/videos/rate.ts +++ b/server/controllers/api/videos/rate.ts | |||
@@ -143,7 +143,7 @@ function rateVideo (req: express.Request, res: express.Response) { | |||
143 | .then(() => logger.info('User video rate for video %s of user %s updated.', videoInstance.name, userInstance.username)) | 143 | .then(() => logger.info('User video rate for video %s of user %s updated.', videoInstance.name, userInstance.username)) |
144 | .catch(err => { | 144 | .catch(err => { |
145 | // This is just a debug because we will retry the insert | 145 | // This is just a debug because we will retry the insert |
146 | logger.debug('Cannot add the user video rate.', { error: err }) | 146 | logger.debug('Cannot add the user video rate.', err) |
147 | throw err | 147 | throw err |
148 | }) | 148 | }) |
149 | } | 149 | } |