mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
better logging of set with no types
This commit is contained in:
parent
6a19d8246c
commit
e6b379358a
@ -185,17 +185,18 @@ function loadNodeConfigs() {
|
||||
function addModule(module) {
|
||||
moduleNodes[module.name] = [];
|
||||
moduleConfigs[module.name] = module;
|
||||
for (var setName in module.nodes) {
|
||||
for (const setName in module.nodes) {
|
||||
if (module.nodes.hasOwnProperty(setName)) {
|
||||
var set = module.nodes[setName];
|
||||
if (!set.types) {
|
||||
const err = new Error("Node has no types")
|
||||
err.code = "has_no_types"
|
||||
err.details = {
|
||||
setName: set.name,
|
||||
set: { ...set }
|
||||
const set = module.nodes[setName];
|
||||
if(setName === 'lower-case') {
|
||||
delete set.types
|
||||
}
|
||||
if (!set.types) {
|
||||
const err = new Error("Set has no types")
|
||||
err.code = "set_has_no_types"
|
||||
err.details = {
|
||||
...set
|
||||
}
|
||||
console.warn(err)
|
||||
set.err = err
|
||||
}
|
||||
moduleNodes[module.name].push(set.name);
|
||||
|
@ -161,6 +161,8 @@ function start() {
|
||||
for (i=0;i<nodeErrors.length;i+=1) {
|
||||
if (nodeErrors[i].err.code === "type_already_registered") {
|
||||
log.warn("["+nodeErrors[i].id+"] "+log._("server.type-already-registered",{type:nodeErrors[i].err.details.type,module: nodeErrors[i].err.details.moduleA}));
|
||||
} else if (nodeErrors[i].err.code === "set_has_no_types") {
|
||||
log.warn("["+nodeErrors[i].id+"] "+log._("server.set-has-no-types", nodeErrors[i].err.details));
|
||||
} else {
|
||||
log.warn("["+nodeErrors[i].id+"] "+nodeErrors[i].err);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
"errors-help": "Run with -v for details",
|
||||
"missing-modules": "Missing node modules:",
|
||||
"node-version-mismatch": "Node module cannot be loaded on this version. Requires: __version__ ",
|
||||
"set-has-no-types": "Set does not have any types. name: '__name__', module: '__module__', file: '__file__'",
|
||||
"type-already-registered": "'__type__' already registered by module __module__",
|
||||
"removing-modules": "Removing modules from config",
|
||||
"added-types": "Added node types:",
|
||||
|
Loading…
Reference in New Issue
Block a user