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

Imposible to catch an error #201

Open
ceritium opened this issue Dec 15, 2019 · 5 comments
Open

Imposible to catch an error #201

ceritium opened this issue Dec 15, 2019 · 5 comments

Comments

@ceritium
Copy link

Hi, I am having troubles trying to open a magnet URL with this code:

const torrentStream = require('torrent-stream')

var magnetUrl = "weird magnet url"

try {
  ts = torrentStream(magnetUrl)
} catch (e) {
  console.log('it is not happening')
}

It returns

/Users/jose.galisteo/work/fuse-torrent/node_modules/parse-torrent-file/node_modules/bencode/lib/decode.js:50
  throw new Error(
  ^

Error: Invalid data: Missing delimiter ":" [0x3a]
    at Function.decode.find (/Users/jose.galisteo/work/fuse-torrent/node_modules/parse-torrent-file/node_modules/bencode/lib/decode.js:50:9)
    at Function.decode.bytes (/Users/jose.galisteo/work/fuse-torrent/node_modules/parse-torrent-file/node_modules/bencode/lib/decode.js:103:23)
    at Function.decode.next (/Users/jose.galisteo/work/fuse-torrent/node_modules/parse-torrent-file/node_modules/bencode/lib/decode.js:33:30)
    at Object.decode (/Users/jose.galisteo/work/fuse-torrent/node_modules/parse-torrent-file/node_modules/bencode/lib/decode.js:19:17)
    at decodeTorrentFile (/Users/jose.galisteo/work/fuse-torrent/node_modules/parse-torrent-file/index.js:16:23)
    at parseTorrent (/Users/jose.galisteo/work/fuse-torrent/node_modules/torrent-stream/node_modules/parse-torrent/index.js:22:12)
    at /Users/jose.galisteo/work/fuse-torrent/node_modules/torrent-stream/index.js:621:21
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

I have no problems opening other magnet URLs; the weird thing is that the problematic magnet URL works well on webtorrent.

I would like at least be able to catch the error. Any suggestion? I can share the magnet URL by PM

@4c7x3n9
Copy link

4c7x3n9 commented Jan 12, 2020

Hi, i have the same problem did you solve that ?

@ceritium
Copy link
Author

No, sorry.

@4c7x3n9
Copy link

4c7x3n9 commented Jan 13, 2020

the problem i think is related to the file system i was running my application in alpine container then i switched to ubuntu and i no longer see this error again.

@ceritium
Copy link
Author

Not sure, It's happening to me on macos.

@josefson
Copy link

I was also experiencing this same error on archlinux. It turned out after removing the /tmp/torrent-stream directory everything started working again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants