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

Include load error in notification of unknown node

This commit is contained in:
Nick O'Leary 2021-09-30 15:39:45 +01:00
parent 29e903e1c8
commit 8761e61439
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 12 additions and 3 deletions

View File

@ -545,7 +545,7 @@
"nodeDisabled": "Node disabled:",
"nodeDisabled_plural": "Nodes disabled:",
"nodeUpgraded": "Node module __module__ upgraded to version __version__",
"unknownNodeRegistered": "Unrecognised node type registered: <ul><li>__type__</li></ul>"
"unknownNodeRegistered": "Error loading node: <ul><li>__type__<br>__error__</li></ul>"
},
"editor": {
"title": "Manage palette",

View File

@ -144,8 +144,17 @@ RED.nodes = (function() {
registerNodeType: function(nt,def) {
if (nt.substring(0,8) != "subflow:") {
if (!nodeSets[typeToId[nt]]) {
var fullType = (RED._loadingModule?("["+RED._loadingModule+"] "):"")+nt
RED.notify(RED._("palette.event.unknownNodeRegistered",{type:fullType}), "error");
var error = "";
var fullType = nt;
if (RED._loadingModule) {
fullType = "["+RED._loadingModule+"] "+nt;
if (nodeSets[RED._loadingModule]) {
error = nodeSets[RED._loadingModule].err || "";
} else {
error = "Unknown error";
}
}
RED.notify(RED._("palette.event.unknownNodeRegistered",{type:fullType, error:error}), "error");
return;
}
def.set = nodeSets[typeToId[nt]];