aboutsummaryrefslogtreecommitdiffhomepage
path: root/server.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-02-07 12:01:40 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-02-07 12:01:40 +0100
commitac2f99eb75ea0295dc08e47b91f4b4d54829d004 (patch)
tree9f0d6d70be66545df336f75be5f1bdefa62c70ca /server.js
parenta030a9b234d315c180f40d8abd177637c1a91f6a (diff)
downloadPeerTube-ac2f99eb75ea0295dc08e47b91f4b4d54829d004.tar.gz
PeerTube-ac2f99eb75ea0295dc08e47b91f4b4d54829d004.tar.zst
PeerTube-ac2f99eb75ea0295dc08e47b91f4b4d54829d004.zip
Don't use process.exit, throw an error instead
Diffstat (limited to 'server.js')
-rw-r--r--server.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/server.js b/server.js
index 6312a4048..c971982b3 100644
--- a/server.js
+++ b/server.js
@@ -18,9 +18,7 @@ var checker = require('./initializers/checker')
18 18
19var miss = checker.checkConfig() 19var miss = checker.checkConfig()
20if (miss.length !== 0) { 20if (miss.length !== 0) {
21 // Do not use logger module 21 throw new Error('Miss some configurations keys : ' + miss)
22 console.error('Miss some configurations keys.', { miss: miss })
23 process.exit(0)
24} 22}
25 23
26checker.createDirectoriesIfNotExist() 24checker.createDirectoriesIfNotExist()
@@ -145,7 +143,7 @@ peertubeCrypto.createCertsIfNotExist(function (err) {
145 } 143 }
146 144
147 function exitGracefullyOnSignal () { 145 function exitGracefullyOnSignal () {
148 process.exit() 146 process.exit(-1)
149 } 147 }
150 148
151 process.on('exit', cleanForExit) 149 process.on('exit', cleanForExit)