mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 20:22:53 +00:00
Use just one callback statement in case of failure on loader of the
configuration file.
This commit is contained in:
parent
bd0de83d31
commit
2168838365
@ -69,14 +69,12 @@ var App = function() {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code == "ENOENT") {
|
if (e.code == "ENOENT") {
|
||||||
console.error("WARNING! Could not find config file. Please create one. Starting with default configuration.");
|
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) {
|
} 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("WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.");
|
||||||
callback(defaults);
|
|
||||||
} else {
|
} else {
|
||||||
console.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e);
|
console.error("WARNING! Could not load config file. Starting with default configuration. Error found: " + e);
|
||||||
callback(defaults);
|
|
||||||
}
|
}
|
||||||
|
callback(defaults);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user