aboutsummaryrefslogtreecommitdiffhomepage
path: root/controllers/api/v1/pods.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-02-05 19:02:05 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-02-05 19:02:05 +0100
commit8425cb894d4867d26fd5f7fae7862b0669f3c717 (patch)
tree5e2f00a8219e198f2dd074ca13f3ae681174228f /controllers/api/v1/pods.js
parentdac0a5319ab1c52a0958647b1593f85339b77e29 (diff)
downloadPeerTube-8425cb894d4867d26fd5f7fae7862b0669f3c717.tar.gz
PeerTube-8425cb894d4867d26fd5f7fae7862b0669f3c717.tar.zst
PeerTube-8425cb894d4867d26fd5f7fae7862b0669f3c717.zip
Error handling mini refractoring
Diffstat (limited to 'controllers/api/v1/pods.js')
-rw-r--r--controllers/api/v1/pods.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/controllers/api/v1/pods.js b/controllers/api/v1/pods.js
index 29517ba8e..456f53dea 100644
--- a/controllers/api/v1/pods.js
+++ b/controllers/api/v1/pods.js
@@ -39,13 +39,13 @@
39 39
40 fs.readFile(peertubeCrypto.getCertDir() + 'peertube.pub', 'utf8', function (err, cert) { 40 fs.readFile(peertubeCrypto.getCertDir() + 'peertube.pub', 'utf8', function (err, cert) {
41 if (err) { 41 if (err) {
42 logger.error('Cannot read cert file.', { error: err }) 42 logger.error('Cannot read cert file.')
43 return next(err) 43 return next(err)
44 } 44 }
45 45
46 Videos.listOwned(function (err, videos_list) { 46 Videos.listOwned(function (err, videos_list) {
47 if (err) { 47 if (err) {
48 logger.error('Cannot get the list of owned videos.', { error: err }) 48 logger.error('Cannot get the list of owned videos.')
49 return next(err) 49 return next(err)
50 } 50 }
51 51
@@ -78,7 +78,8 @@
78 78
79 Videos.removeAllRemotesOf(url, function (err) { 79 Videos.removeAllRemotesOf(url, function (err) {
80 if (err) logger.error('Cannot remove all remote videos of %s.', url) 80 if (err) logger.error('Cannot remove all remote videos of %s.', url)
81 logger.info('%s pod removed.', url) 81 else logger.info('%s pod removed.', url)
82
82 res.sendStatus(204) 83 res.sendStatus(204)
83 }) 84 })
84 }) 85 })