scttcper / deluge

Deluge API wrapper

Home Page:https://deluge.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception thrown when calling getTorrentStatus on a non-existent hash

mitchellhuang opened this issue · comments

const status = await deluge.getTorrentStatus(HASH_THAT_DOES_NOT_EXIST);

The above will hang for timeout ms and then throw:

Timeout awaiting 'request' for 1000ms

Is there anyway we can get this to return null instantly or throw instantly? Surely the deluge web API doesn't just hang when requesting a non-existent torrent? Lol I hope not.

Btw it's similar for other methods like getTorrentFiles, etc

@mitchellhuang deluge 2.x seems to respond correctly and quickly. added an error if it returns without the torrent data.

looks like there's other issues with deluge 2 though

Interesting - I'll poke around on 2.x. I'm running 1.3.x rn. What are the issues? Major ones?

just the api responses don't match the types, looks like some good improvements though