Merge pull request #751 from roramirez/callback-fail-load-config

Use just one callback statement in case of failure on configuration loader
This commit is contained in:
Michael Teeuw 2017-03-10 14:53:36 +01:00 committed by GitHub
commit 6d07d5dccb

View File

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