Imposible to catch an error
See original GitHub issueHi, 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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
What Exceptions Cannot Be Caught by try-catch? | by bytefish
1. Can not catch syntaxError. When code reports an error, an exception cannot be caught if the thread has not yet entered a...
Read more >How do you handle "impossible" exceptions in Java?
An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Share.
Read more >It's impossible to catch errors for futures that complete before ...
If a future completes with an error before a catchError callback is registered, it's seemingly impossible to catch that error.
Read more >Error handling, "try...catch" - The Modern JavaScript Tutorial
So, try...catch can only handle errors that occur in valid code. Such errors are called “runtime errors” or, sometimes, “exceptions”.
Read more >Solved: Hard to Catch Error - Microsoft Power BI Community
Solved: Hello, Could someone on the Microsoft side confirm what's going on in a certain hard to catch error scenario? For both of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was also experiencing this same error on archlinux. It turned out after removing the /tmp/torrent-stream directory everything started working again
Not sure, It’s happening to me on macos.