Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign uphow I cand handle errors when adding torrents to a client? #1210
Comments
This comment has been minimized.
This comment has been minimized.
|
I believe you can do something like this: client.on('error', function (err) {
// Handle error
})
client.on('warning', function (err) {
// Handle warning
}) |
This comment has been minimized.
This comment has been minimized.
|
Yes but I want to manage the duplicated torrent and invalid torrent identifier when adding a torrent. |
This comment has been minimized.
This comment has been minimized.
|
@rafaelleru You need to use the error event of the client. The onTorrent callback function of |
This comment has been minimized.
This comment has been minimized.
|
You can also listen for the torrent.on('error', function (err) {})From the docs:
|
I tryed
client.add(t, function(err, torrent){manage error if it happens here})but didn't work.