1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Improve error message if settings file fails to load

This commit is contained in:
Nick O'Leary 2015-09-26 22:50:29 +01:00
parent ee37464741
commit 5f9780d71c

5
red.js
View File

@ -100,8 +100,11 @@ try {
var settings = require(settingsFile); var settings = require(settingsFile);
settings.settingsFile = settingsFile; settings.settingsFile = settingsFile;
} catch(err) { } catch(err) {
console.log("Error loading settings file: "+settingsFile)
if (err.code == 'MODULE_NOT_FOUND') { if (err.code == 'MODULE_NOT_FOUND') {
console.log("Unable to load settings file: "+settingsFile); if (err.toString().indexOf(settingsFile) === -1) {
console.log(err.toString());
}
} else { } else {
console.log(err); console.log(err);
} }