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 upwebtorrent crash app when torrent info field empty #797
Comments
This comment has been minimized.
This comment has been minimized.
|
It looks like you're using the If you get this error, it means that you're trying to parse an invalid torrent. All torrent need an Can you share a complete code example? I can point out where you need to handle potential errors. |
This comment has been minimized.
This comment has been minimized.
|
It's weird because I never use parse-torrent directly ... I use the WebTorrent client right here:
|
This comment has been minimized.
This comment has been minimized.
|
I see. So, you should always attach an 'error' event handler to the client.on('error', function (err) {
console.log('there was an error: ', err)
})If you want to distinguish which torrent caused the error, you should attach a listener to the var torrent = client.add(torrentLink, onTorrent)
torrent.on('error', function (err) {
console.log('there was an error: ', err)
}) |
This comment has been minimized.
This comment has been minimized.
|
I have done what you told me to do.
|
This comment has been minimized.
This comment has been minimized.
|
@Lunik I think you must have done something wrong. Make sure that you're adding an 'error' handler to both the client and the torrent object. |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
0.93.1
v6
Some time torrent file don't contain info field and it make my application crash.
Is there a way to log error without crashing the app ?
Maybe with a try catch ?