Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to verify if the given torrentId is valid? #1416

Closed
Shai1436 opened this issue Jun 13, 2018 · 2 comments
Closed

How to verify if the given torrentId is valid? #1416

Shai1436 opened this issue Jun 13, 2018 · 2 comments

Comments

@Shai1436
Copy link

@Shai1436 Shai1436 commented Jun 13, 2018

Is there any out of the box function to check if the given torrentId/magnetURI is valid before adding it to the client?
Will client.on('error', function (err) {}) API be called in those cases?
If not what is the best way to do it?

@KayleePop

This comment has been minimized.

Copy link
Contributor

@KayleePop KayleePop commented Jun 20, 2018

Yep, the error event will be called

https://jsfiddle.net/aw9h86zk/

@SilentBot1

This comment has been minimized.

Copy link
Member

@SilentBot1 SilentBot1 commented Jun 30, 2018

Hey @Shai1436,

As @KayleePop has said, there is no out of the box solution for checking if a identifier is valid before adding it to the client, but the error event will be emitted from the client if a identifier isn't valid after being added to the client.

Note: if torrent.on('error', ()=>{}) is listened to, the error event will be emitted here instead of from the client.

@SilentBot1 SilentBot1 closed this Jun 30, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.