From dded87c1346ee490306f7339609864a8b1ba01d5 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sun, 8 Jun 2014 23:28:46 +0100 Subject: [PATCH] Log close errors rather than pass up the stack --- red/nodes/flows.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/red/nodes/flows.js b/red/nodes/flows.js index 5d07739e5..304cb351b 100644 --- a/red/nodes/flows.js +++ b/red/nodes/flows.js @@ -124,9 +124,13 @@ var flowNodes = module.exports = { events.emit("nodes-stopping"); var promises = []; for (var n in nodes) { - var p = nodes[n].close(); - if (p) { - promises.push(p); + try { + var p = nodes[n].close(); + if (p) { + promises.push(p); + } + } catch(err) { + nodes[n].error(err); } } when.settle(promises).then(function() {