@node-red/runtime
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -86,2 +86,3 @@ /** | ||
try { | ||
Object.defineProperty(conf,'_module', {value: typeRegistry.getNodeInfo(type), enumerable: false, writable: true }) | ||
Object.defineProperty(conf,'_flow', {value: flow, enumerable: false, writable: true }) | ||
@@ -88,0 +89,0 @@ newNode = new nodeTypeConstructor(conf); |
@@ -62,2 +62,5 @@ /** | ||
} | ||
if (n._module) { | ||
Object.defineProperty(this,'_module', {value: n._module, enumerable: false, writable: true }) | ||
} | ||
this.updateWires(n.wires); | ||
@@ -500,3 +503,8 @@ } | ||
} | ||
self._flow.log(o); | ||
// See https://github.com/node-red/node-red/issues/3327 | ||
try { | ||
self._flow.log(o); | ||
} catch(err) { | ||
logUnexpectedError(self, err) | ||
} | ||
} | ||
@@ -581,2 +589,57 @@ /** | ||
function inspectObject(flow) { | ||
try { | ||
let properties = new Set() | ||
let currentObj = flow | ||
do { | ||
if (!Object.getPrototypeOf(currentObj)) { break } | ||
Object.getOwnPropertyNames(currentObj).map(item => properties.add(item)) | ||
} while ((currentObj = Object.getPrototypeOf(currentObj))) | ||
let propList = [...properties.keys()].map(item => `${item}[${(typeof flow[item])[0]}]`) | ||
propList.sort(); | ||
let result = []; | ||
let line = ""; | ||
while (propList.length > 0) { | ||
let prop = propList.shift() | ||
if (line.length+prop.length > 80) { | ||
result.push(line) | ||
line = ""; | ||
} else { | ||
line += " "+prop | ||
} | ||
} | ||
if (line.length > 0) { | ||
result.push(line); | ||
} | ||
return result.join("\n ") | ||
} catch(err) { | ||
return "Failed to capture object properties: "+err.toString() | ||
} | ||
} | ||
function logUnexpectedError(node, error) { | ||
let moduleInfo = node._module?`${node._module.module}@${node._module.version}`:"undefined" | ||
Log.error(` | ||
******************************************************************** | ||
Unexpected Node Error | ||
${error.stack} | ||
Node: | ||
Type: ${node.type} | ||
Module: ${moduleInfo} | ||
ID: ${node._alias||node.id} | ||
Properties: | ||
${inspectObject(node)} | ||
Flow: ${node._flow?node._flow.path:'undefined'} | ||
Type: ${node._flow?node._flow.TYPE:'undefined'} | ||
Properties: | ||
${node._flow?inspectObject(node._flow):'undefined'} | ||
Please report this issue, including the information logged above: | ||
https://github.com/node-red/node-red/issues/ | ||
******************************************************************** | ||
`) | ||
} | ||
module.exports = Node; |
{ | ||
"name": "@node-red/runtime", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"license": "Apache-2.0", | ||
@@ -19,7 +19,7 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"@node-red/registry": "2.1.4", | ||
"@node-red/util": "2.1.4", | ||
"@node-red/registry": "2.1.5", | ||
"@node-red/util": "2.1.5", | ||
"async-mutex": "0.3.2", | ||
"clone": "2.1.2", | ||
"express": "4.17.1", | ||
"express": "4.17.2", | ||
"fs-extra": "10.0.0", | ||
@@ -26,0 +26,0 @@ "json-stringify-safe": "5.0.1" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
544149
12744
+ Added@node-red/registry@2.1.5(transitive)
+ Added@node-red/util@2.1.5(transitive)
+ Addedbody-parser@1.19.1(transitive)
+ Addedbytes@3.1.1(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcookie@0.4.1(transitive)
+ Addedexpress@4.17.2(transitive)
+ Addedhttp-errors@1.8.1(transitive)
+ Addedi18next@21.6.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedms@2.1.3(transitive)
+ Addedqs@6.9.6(transitive)
+ Addedraw-body@2.4.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsend@0.17.2(transitive)
+ Addedserve-static@1.14.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addeduglify-js@3.14.5(transitive)
- Removed@node-red/registry@2.1.4(transitive)
- Removed@node-red/util@2.1.4(transitive)
- Removedbody-parser@1.19.0(transitive)
- Removedbytes@3.1.0(transitive)
- Removedcontent-disposition@0.5.3(transitive)
- Removedcookie@0.4.0(transitive)
- Removedexpress@4.17.1(transitive)
- Removedhttp-errors@1.7.2(transitive)
- Removedi18next@21.5.4(transitive)
- Removedinherits@2.0.3(transitive)
- Removedms@2.1.1(transitive)
- Removedqs@6.7.0(transitive)
- Removedraw-body@2.4.0(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsend@0.17.1(transitive)
- Removedserve-static@1.14.1(transitive)
- Removedsetprototypeof@1.1.1(transitive)
- Removedtoidentifier@1.0.0(transitive)
- Removeduglify-js@3.14.4(transitive)
Updated@node-red/registry@2.1.5
Updated@node-red/util@2.1.5
Updatedexpress@4.17.2