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

[FIX] Call wrong error handeling

This commit is contained in:
Antoine Aflalo 2014-04-21 00:25:49 +03:00
parent ce7b5db629
commit 21ef4218c0

View File

@ -30,10 +30,11 @@ function KickassNode(n) {
});
this.on("input", function (msg) {
var query = msg.topic || this.title;
this.kickass.setQuery(query).run(function (errors, data) {
if (!errors.length > 0) {
msg.topic = query;
msg.payload = [];
this.kickass.setQuery(query).run(function (errors, data) {
if (!errors.length > 0) {
data.forEach(function (torrent) {
var parsedTorrent = {};
parsedTorrent.title = torrent.title;
@ -47,7 +48,8 @@ function KickassNode(n) {
});
node.send(msg);
} else {
node.err(errors);
node.error(errors);
node.send(msg);
}
});
});