Use color red for error when the configuration file is not found.

This commit is contained in:
Rodrigo Ramírez Norambuena 2017-03-05 22:20:35 -03:00
parent 2168838365
commit 1e3b866c8b
2 changed files with 5 additions and 4 deletions

View File

@ -68,11 +68,11 @@ var App = function() {
callback(config);
} catch (e) {
if (e.code == "ENOENT") {
console.error("WARNING! Could not find config file. Please create one. Starting with default configuration.");
console.error(Utils.colors.error("WARNING! Could not find config file. Please create one. Starting with default configuration."));
} else if (e instanceof ReferenceError || e instanceof SyntaxError) {
console.error("WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.");
console.error(Utils.colors.error("WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration."));
} else {
console.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e);
console.error(Utils.colors.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e));
}
callback(defaults);
}

View File

@ -10,7 +10,8 @@ var colors = require("colors/safe");
var Utils = {
colors: {
warn: colors.yellow
warn: colors.yellow,
error: colors.red
}
};