From ac2f99eb75ea0295dc08e47b91f4b4d54829d004 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 7 Feb 2016 12:01:40 +0100 Subject: Don't use process.exit, throw an error instead --- server.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'server.js') 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') var miss = checker.checkConfig() if (miss.length !== 0) { - // Do not use logger module - console.error('Miss some configurations keys.', { miss: miss }) - process.exit(0) + throw new Error('Miss some configurations keys : ' + miss) } checker.createDirectoriesIfNotExist() @@ -145,7 +143,7 @@ peertubeCrypto.createCertsIfNotExist(function (err) { } function exitGracefullyOnSignal () { - process.exit() + process.exit(-1) } process.on('exit', cleanForExit) -- cgit v1.2.3