Skip to content

Commit 92f6d1d

Browse files
committed
bouncer: error message when config file not found
1 parent 8f4b6d7 commit 92f6d1d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

bouncer.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ const reverse = require('util').promisify(dns.reverse);
1111
// Load jbnc.conf
1212
_config = process.argv[2]?process.argv[2]:"jbnc.conf";
1313
var config = {};
14-
if(fs.existsSync(_config)) config = JSON.parse(fs.readFileSync(_config));
15-
else process.exit(1);
14+
if(fs.existsSync(_config)) {
15+
config = JSON.parse(fs.readFileSync(_config));
16+
}
17+
else {
18+
console.error(`No config file found: ${_config}`);
19+
process.exit(1);
20+
}
1621

1722
// Set config vars
1823
var BOUNCER_PORT = config.bouncerPort?config.bouncerPort:8888;

0 commit comments

Comments
 (0)