diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-02-07 12:01:40 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-02-07 12:01:40 +0100 |
commit | ac2f99eb75ea0295dc08e47b91f4b4d54829d004 (patch) | |
tree | 9f0d6d70be66545df336f75be5f1bdefa62c70ca /server.js | |
parent | a030a9b234d315c180f40d8abd177637c1a91f6a (diff) | |
download | PeerTube-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.js | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -18,9 +18,7 @@ var checker = require('./initializers/checker') | |||
18 | 18 | ||
19 | var miss = checker.checkConfig() | 19 | var miss = checker.checkConfig() |
20 | if (miss.length !== 0) { | 20 | if (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 | ||
26 | checker.createDirectoriesIfNotExist() | 24 | checker.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) |