This commit is contained in:
Matthias Urlichs
2024-12-08 06:46:47 -05:00
committed by GitHub
3 changed files with 9 additions and 0 deletions

View File

@@ -41,6 +41,7 @@
"cors": "2.8.5",
"cronosjs": "1.7.1",
"denque": "2.1.0",
"detect-mocha": "^0.1.0",
"express": "4.21.1",
"express-session": "1.18.1",
"form-data": "4.0.0",

View File

@@ -21,6 +21,7 @@ const flowUtil = require("./util");
const context = require('../nodes/context');
const hooks = require("@node-red/util").hooks;
const credentials = require("../nodes/credentials");
const detectMocha = require("detect-mocha");
let Subflow;
let Log;
@@ -804,6 +805,9 @@ function deliverMessageToDestination(sendEvent) {
} catch(err) {
Log.error(`Error delivering message to node:${sendEvent.destination.node._path} [${sendEvent.destination.node.type}]`)
Log.error(err.stack)
if (detectMocha()) {
throw err;
}
}
}
}

View File

@@ -21,6 +21,7 @@ var redUtil = require("@node-red/util").util;
var Log = require("@node-red/util").log;
var context = require("./context");
var flows = require("../flows");
var detectMocha = require("detect-mocha");
const hooks = require("@node-red/util").hooks;
@@ -218,6 +219,9 @@ Node.prototype._emitInput = function(arg) {
);
} catch(err) {
node.error(err,arg);
if (detectMocha()) {
throw err;
}
}
} else if (node._inputCallbacks) {
// Multiple callbacks registered. Call each one, tracking eventual completion