mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Remove thrown Errors and add some color to the ouput
This commit is contained in:
parent
0056e0bc6d
commit
66609428a2
@ -55,14 +55,13 @@ function checkConfigFile() {
|
|||||||
}
|
}
|
||||||
const messages = linter.verify(data);
|
const messages = linter.verify(data);
|
||||||
if (messages.length === 0) {
|
if (messages.length === 0) {
|
||||||
Log.log("Your configuration file doesn't contain syntax errors :)");
|
Log.info(Utils.colors.pass("Your configuration file doesn't contain syntax errors :)"));
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
|
Log.error(Utils.colors.error("Your configuration file contains syntax errors :("));
|
||||||
// In case the there errors show messages and return
|
// In case the there errors show messages and return
|
||||||
messages.forEach((error) => {
|
messages.forEach((error) => {
|
||||||
Log.log("Line", error.line, "col", error.column, error.message);
|
Log.error("Line", error.line, "col", error.column, error.message);
|
||||||
});
|
});
|
||||||
throw new Error("Wrong syntax in config file!");
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,8 @@ var Utils = {
|
|||||||
colors: {
|
colors: {
|
||||||
warn: colors.yellow,
|
warn: colors.yellow,
|
||||||
error: colors.red,
|
error: colors.red,
|
||||||
info: colors.blue
|
info: colors.blue,
|
||||||
|
pass: colors.green
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user