mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
fix error report on node load
This commit is contained in:
parent
aa5e47b462
commit
3671a70e3b
@ -385,10 +385,17 @@ function loadNodeSet(node) {
|
||||
var stack = err.stack;
|
||||
var message;
|
||||
if (stack) {
|
||||
var i = stack.indexOf(node.file);
|
||||
var filePath = node.file;
|
||||
try {
|
||||
filePath = fs.realpathSync(filePath);
|
||||
}
|
||||
catch (e) {
|
||||
// ignore canonicalization error
|
||||
}
|
||||
var i = stack.indexOf(filePath);
|
||||
if (i > -1) {
|
||||
var excerpt = stack.substring(i+node.file.length+1,i+node.file.length+20);
|
||||
var m = /^(\d+):(\d+)/.exec(excerpt);
|
||||
var excerpt = stack.substring(i+filePath.length+1,i+filePath.length+20);
|
||||
var m = /^(\d+)/.exec(excerpt);
|
||||
if (m) {
|
||||
node.err = err+" (line:"+m[1]+")";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user