Merge pull request #785 from roramirez/colors-error

Use color red for error when the configuration file is not found.
This commit is contained in:
Michael Teeuw 2017-03-18 21:50:18 +01:00 committed by GitHub
commit c62082b924
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
}
};