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:
parent
ce7b5db629
commit
21ef4218c0
@ -30,10 +30,11 @@ function KickassNode(n) {
|
|||||||
});
|
});
|
||||||
this.on("input", function (msg) {
|
this.on("input", function (msg) {
|
||||||
var query = msg.topic || this.title;
|
var query = msg.topic || this.title;
|
||||||
this.kickass.setQuery(query).run(function (errors, data) {
|
|
||||||
if (!errors.length > 0) {
|
|
||||||
msg.topic = query;
|
msg.topic = query;
|
||||||
msg.payload = [];
|
msg.payload = [];
|
||||||
|
this.kickass.setQuery(query).run(function (errors, data) {
|
||||||
|
if (!errors.length > 0) {
|
||||||
|
|
||||||
data.forEach(function (torrent) {
|
data.forEach(function (torrent) {
|
||||||
var parsedTorrent = {};
|
var parsedTorrent = {};
|
||||||
parsedTorrent.title = torrent.title;
|
parsedTorrent.title = torrent.title;
|
||||||
@ -47,7 +48,8 @@ function KickassNode(n) {
|
|||||||
});
|
});
|
||||||
node.send(msg);
|
node.send(msg);
|
||||||
} else {
|
} else {
|
||||||
node.err(errors);
|
node.error(errors);
|
||||||
|
node.send(msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user