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

WebTorrent.Seed should return an error if it cannot connect to the tracker #333

Closed
gmbuell opened this issue May 28, 2015 · 1 comment
Closed

Comments

@gmbuell
Copy link

@gmbuell gmbuell commented May 28, 2015

There is currently no way to tell if connecting to the tracker was successful.

Example:

var client = new WebTorrent()
client.seed(input, { announceList: [["invalid://definitely-not-valid"]]})

Seed should support an error callback with debug information.

@feross

This comment has been minimized.

Copy link
Member

@feross feross commented May 29, 2015

This is fixed in webtorrent 0.48.0. You can check for warnings like this:

  var torrent = client.seed(buf, { announce: ['invalid://definitely-not-valid'] })
  torrent.on('warning', function (err) {
    console.log('torrent warning', err.message)
  })

You should probably always be attaching a 'warning' handler and logging warnings since they contain useful information. There's also the 'error' event which is even more important to listen for.

@feross feross closed this May 29, 2015
@lock lock bot locked as resolved and limited conversation to collaborators May 6, 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
2 participants
You can’t perform that action at this time.