Remove thrown Errors and add some color to the ouput

This commit is contained in:
rejas 2020-08-08 22:16:27 +02:00
parent 0056e0bc6d
commit 66609428a2
2 changed files with 5 additions and 5 deletions

View File

@ -55,14 +55,13 @@ function checkConfigFile() {
} }
const messages = linter.verify(data); const messages = linter.verify(data);
if (messages.length === 0) { if (messages.length === 0) {
Log.log("Your configuration file doesn't contain syntax errors :)"); Log.info(Utils.colors.pass("Your configuration file doesn't contain syntax errors :)"));
return true;
} else { } else {
Log.error(Utils.colors.error("Your configuration file contains syntax errors :("));
// In case the there errors show messages and return // In case the there errors show messages and return
messages.forEach((error) => { 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!");
} }
}); });
} }

View File

@ -10,7 +10,8 @@ var Utils = {
colors: { colors: {
warn: colors.yellow, warn: colors.yellow,
error: colors.red, error: colors.red,
info: colors.blue info: colors.blue,
pass: colors.green
} }
}; };