aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-10-01 09:48:49 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-10-01 09:48:49 +0200
commitb91359055f632d8a76171a2c99f08fb4f38f11c4 (patch)
tree74d826602c4eecf269e0cc6d0f708699c3a6ad3e /server/models
parent14ad0c276b4948476d58c82270f2107c8ae5ecd8 (diff)
downloadPeerTube-b91359055f632d8a76171a2c99f08fb4f38f11c4.tar.gz
PeerTube-b91359055f632d8a76171a2c99f08fb4f38f11c4.tar.zst
PeerTube-b91359055f632d8a76171a2c99f08fb4f38f11c4.zip
Server: add information why a friend request failed (status code)
Diffstat (limited to 'server/models')
-rw-r--r--server/models/request.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/server/models/request.js b/server/models/request.js
index 4e510e18a..b36b4f613 100644
--- a/server/models/request.js
+++ b/server/models/request.js
@@ -96,7 +96,14 @@ function makeRequest (toPod, requestsToMake, callback) {
96 // The function fire some useful callbacks 96 // The function fire some useful callbacks
97 requests.makeSecureRequest(params, function (err, res) { 97 requests.makeSecureRequest(params, function (err, res) {
98 if (err || (res.statusCode !== 200 && res.statusCode !== 201 && res.statusCode !== 204)) { 98 if (err || (res.statusCode !== 200 && res.statusCode !== 201 && res.statusCode !== 204)) {
99 logger.error('Error sending secure request to %s pod.', toPod.url, { error: err || new Error('Status code not 20x') }) 99 logger.error(
100 'Error sending secure request to %s pod.',
101 toPod.url,
102 {
103 error: err || new Error('Status code not 20x'),
104 statusCode: res.statusCode
105 }
106 )
100 107
101 return callback(false) 108 return callback(false)
102 } 109 }
@@ -160,12 +167,6 @@ function makeRequests () {
160 } 167 }
161 168
162 makeRequest(toPod, requestToMake.datas, function (success) { 169 makeRequest(toPod, requestToMake.datas, function (success) {
163 if (err) {
164 logger.error('Errors when sent request to %s.', toPod.url, { error: err })
165 // Do not stop the process just for one error
166 return callbackEach()
167 }
168
169 if (success === true) { 170 if (success === true) {
170 logger.debug('Removing requests for %s pod.', toPodId, { requestsIds: requestToMake.ids }) 171 logger.debug('Removing requests for %s pod.', toPodId, { requestsIds: requestToMake.ids })
171 172