From 874837666ce7429a59ad41972532e3d447e17a88 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Fri, 13 Jul 2018 23:52:28 +0900 Subject: [PATCH] Update error message --- src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c5f5d32e57..44d42f94c1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,11 +122,13 @@ async function init(): Promise { configLogger.info(`Maintainer: ${config.maintainer.name}`); if (process.platform === 'linux' && !isRoot() && config.port < 1024) { - throw 'You need root privileges to listen on port below 1024 on Linux'; + Logger.error('You need root privileges to listen on port below 1024 on Linux'); + process.exit(1); } if (await portscanner.checkPortStatus(config.port, '127.0.0.1') === 'open') { - throw `Port ${config.port} is already in use`; + Logger.error(`Port ${config.port} is already in use`) + process.exit(1); } // Try to connect to MongoDB