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

fix error stack

This commit is contained in:
Martin Guillon 2018-04-17 15:46:09 +02:00 committed by GitHub
parent 20f03c356c
commit 5967f4b0d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,7 +224,15 @@ module.exports = function(RED) {
this.status({fill:"yellow",shape:"dot",text:""+converted}); this.status({fill:"yellow",shape:"dot",text:""+converted});
} }
} catch(err) { } catch(err) {
//remove unwanted part
const index = err.stack.search(/\n\s*at ContextifyScript.Script.runInContext/);
err.stack = err.stack.slice(0, index).split('\n').slice(0,-1).join('\n');
console.log(index, err.stack);
const stack = err.stack.split(/\r?\n/);
//store the error in msg to be used in flows
msg.error = err; msg.error = err;
var line = 0; var line = 0;
var errorMessage; var errorMessage;
var stack = err.stack.split(/\r?\n/); var stack = err.stack.split(/\r?\n/);