mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 12:12:20 +00:00
More precise error messages in case configuration couldn't be loaded.
This commit is contained in:
parent
5d9d71dee8
commit
fd1a31afb6
12
js/app.js
12
js/app.js
@ -41,8 +41,16 @@ var App = function() {
|
|||||||
var config = Object.assign(defaults, c);
|
var config = Object.assign(defaults, c);
|
||||||
callback(config);
|
callback(config);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("WARNING! Could not find config. Please create one.");
|
if (e.code == "ENOENT") {
|
||||||
callback(defaults);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user