From 66609428a2398bf6af538b2d0ece7dbe4fdd83fe Mon Sep 17 00:00:00 2001 From: rejas Date: Sat, 8 Aug 2020 22:16:27 +0200 Subject: [PATCH] Remove thrown Errors and add some color to the ouput --- js/check_config.js | 7 +++---- js/utils.js | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/check_config.js b/js/check_config.js index 058a6d6f..15b1ae3d 100644 --- a/js/check_config.js +++ b/js/check_config.js @@ -55,14 +55,13 @@ function checkConfigFile() { } const messages = linter.verify(data); if (messages.length === 0) { - Log.log("Your configuration file doesn't contain syntax errors :)"); - return true; + Log.info(Utils.colors.pass("Your configuration file doesn't contain syntax errors :)")); } else { + Log.error(Utils.colors.error("Your configuration file contains syntax errors :(")); // In case the there errors show messages and return messages.forEach((error) => { - Log.log("Line", error.line, "col", error.column, error.message); + Log.error("Line", error.line, "col", error.column, error.message); }); - throw new Error("Wrong syntax in config file!"); } }); } diff --git a/js/utils.js b/js/utils.js index 74553f06..5044447d 100644 --- a/js/utils.js +++ b/js/utils.js @@ -10,7 +10,8 @@ var Utils = { colors: { warn: colors.yellow, error: colors.red, - info: colors.blue + info: colors.blue, + pass: colors.green } };