diff --git a/lib/load-config.js b/lib/load-config.js index 80f4706dc..0756c2df4 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -8,7 +8,14 @@ try { console.log("You can configure the administrator email (adminEmail) in your config/config.js file"); } } catch (e) { - console.log("Config not found, loading the example config. You can customize the configuration by copying config/config.example.js to " + configPath); + if (e instanceof SyntaxError) { + console.error("config/config.js is faulty. See stacktrace below for more information. Terminating. \n"); + console.error(e.name + ": " + e.message); + console.error(e.stack.split("\n\n")[0]); + process.exit(1); + } else { + console.log("Config not found, loading the example config. You can customize the configuration by copying config/config.example.js to " + configPath); + } config = require("../config/config.example"); } module.exports = config;