add error msg to sort node

This commit is contained in:
Dave Conway-Jones 2017-12-05 15:01:58 +00:00
parent afce106186
commit 422fbcb0b7
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
1 changed files with 7 additions and 8 deletions

View File

@ -79,11 +79,11 @@ module.exports = function(RED) {
return function(x, y) { return function(x, y) {
var xp = conv(key(x)); var xp = conv(key(x));
var yp = conv(key(y)); var yp = conv(key(y));
if (xp === yp) return 0; if (xp === yp) { return 0; }
if (xp > yp) return dir; if (xp > yp) { return dir; }
return -dir; return -dir;
}; };
}; }
function send_group(group) { function send_group(group) {
var key = key_is_payload var key = key_is_payload
@ -104,7 +104,7 @@ module.exports = function(RED) {
msg.parts.index = i; msg.parts.index = i;
node.send(msg); node.send(msg);
} }
}; }
function sort_payload(msg) { function sort_payload(msg) {
var payload = msg.payload; var payload = msg.payload;
@ -168,7 +168,7 @@ module.exports = function(RED) {
if ((max_msgs > 0) && (pending_count > max_msgs)) { if ((max_msgs > 0) && (pending_count > max_msgs)) {
pending = {}; pending = {};
pending_count = 0; pending_count = 0;
node.error(RED._("sort.too-many")); node.error(RED._("sort.too-many"),msg);
} }
} }
@ -179,4 +179,3 @@ module.exports = function(RED) {
RED.nodes.registerType("sort", SortNode); RED.nodes.registerType("sort", SortNode);
} }