aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-26 15:54:13 +0200
committerChocobozzz <me@florianbigard.com>2018-03-26 16:04:14 +0200
commitd5b7d9110dd637a7f67ce9e430145314812a8df1 (patch)
treed019ef5fe68b14d7e5ad11953b6c1f4811669ce6 /server/controllers/api
parent0dcf9a14be3f8668fe5ee65cf0365d457b4d1499 (diff)
downloadPeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.tar.gz
PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.tar.zst
PeerTube-d5b7d9110dd637a7f67ce9e430145314812a8df1.zip
Fix error logging
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/server/follows.ts6
-rw-r--r--server/controllers/api/videos/blacklist.ts2
-rw-r--r--server/controllers/api/videos/channel.ts4
3 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/server/follows.ts b/server/controllers/api/server/follows.ts
index 4a0a44cd3..bb0063473 100644
--- a/server/controllers/api/server/follows.ts
+++ b/server/controllers/api/server/follows.ts
@@ -93,14 +93,14 @@ async function followRetry (req: express.Request, res: express.Response, next: e
93 93
94 return retryTransactionWrapper(follow, options) 94 return retryTransactionWrapper(follow, options)
95 }) 95 })
96 .catch(err => logger.warn('Cannot follow server %s.', sanitizedHost, err)) 96 .catch(err => logger.warn('Cannot follow server %s.', sanitizedHost, { err }))
97 97
98 tasks.push(p) 98 tasks.push(p)
99 } 99 }
100 100
101 // Don't make the client wait the tasks 101 // Don't make the client wait the tasks
102 Promise.all(tasks) 102 Promise.all(tasks)
103 .catch(err => logger.error('Error in follow.', err)) 103 .catch(err => logger.error('Error in follow.', { err }))
104 104
105 return res.status(204).end() 105 return res.status(204).end()
106} 106}
@@ -144,7 +144,7 @@ async function removeFollow (req: express.Request, res: express.Response, next:
144 // This could be long so don't wait this task 144 // This could be long so don't wait this task
145 const following = follow.ActorFollowing 145 const following = follow.ActorFollowing
146 following.destroy() 146 following.destroy()
147 .catch(err => logger.error('Cannot destroy actor that we do not follow anymore %s.', following.url, err)) 147 .catch(err => logger.error('Cannot destroy actor that we do not follow anymore %s.', following.url, { err }))
148 148
149 return res.status(204).end() 149 return res.status(204).end()
150} 150}
diff --git a/server/controllers/api/videos/blacklist.ts b/server/controllers/api/videos/blacklist.ts
index 7eee460d4..8112b59b8 100644
--- a/server/controllers/api/videos/blacklist.ts
+++ b/server/controllers/api/videos/blacklist.ts
@@ -69,7 +69,7 @@ async function removeVideoFromBlacklistController (req: express.Request, res: ex
69 69
70 return res.sendStatus(204) 70 return res.sendStatus(204)
71 } catch (err) { 71 } catch (err) {
72 logger.error('Some error while removing video %s from blacklist.', res.locals.video.uuid, err) 72 logger.error('Some error while removing video %s from blacklist.', res.locals.video.uuid, { err })
73 throw err 73 throw err
74 } 74 }
75} 75}
diff --git a/server/controllers/api/videos/channel.ts b/server/controllers/api/videos/channel.ts
index fba5681de..e547d375f 100644
--- a/server/controllers/api/videos/channel.ts
+++ b/server/controllers/api/videos/channel.ts
@@ -98,7 +98,7 @@ async function addVideoChannel (req: express.Request, res: express.Response) {
98 }) 98 })
99 99
100 setAsyncActorKeys(videoChannelCreated.Actor) 100 setAsyncActorKeys(videoChannelCreated.Actor)
101 .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, err)) 101 .catch(err => logger.error('Cannot set async actor keys for account %s.', videoChannelCreated.Actor.uuid, { err }))
102 102
103 logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid) 103 logger.info('Video channel with uuid %s created.', videoChannelCreated.Actor.uuid)
104 104
@@ -137,7 +137,7 @@ async function updateVideoChannel (req: express.Request, res: express.Response)
137 137
138 logger.info('Video channel with name %s and uuid %s updated.', videoChannelInstance.name, videoChannelInstance.Actor.uuid) 138 logger.info('Video channel with name %s and uuid %s updated.', videoChannelInstance.name, videoChannelInstance.Actor.uuid)
139 } catch (err) { 139 } catch (err) {
140 logger.debug('Cannot update the video channel.', err) 140 logger.debug('Cannot update the video channel.', { err })
141 141
142 // Force fields we want to update 142 // Force fields we want to update
143 // If the transaction is retried, sequelize will think the object has not changed 143 // If the transaction is retried, sequelize will think the object has not changed