mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
add catch to get_index_from_unique_id
This commit is contained in:
parent
32fc9bbf07
commit
8f6bb96df0
1 changed files with 10 additions and 2 deletions
|
@ -181,11 +181,19 @@ long get_torrent_index(torrent_handle &handle)
|
||||||
|
|
||||||
long get_index_from_unique_ID(long unique_ID)
|
long get_index_from_unique_ID(long unique_ID)
|
||||||
{
|
{
|
||||||
|
try{
|
||||||
for (unsigned long i = 0; i < M_torrents->size(); i++)
|
for (unsigned long i = 0; i < M_torrents->size(); i++)
|
||||||
if ((*M_torrents)[i].unique_ID == unique_ID)
|
if ((*M_torrents)[i].unique_ID == unique_ID)
|
||||||
return i;
|
return i;
|
||||||
|
}
|
||||||
|
catch(invalid_handle&)
|
||||||
|
{
|
||||||
|
printf("invalid handle error on get_index_from_unique_ID. call batman.\n");
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
printf("unknown error on get_index_from_unique_ID. call batman.\n");
|
||||||
|
}
|
||||||
RAISE_INT(DelugeError, "No such unique_ID.");
|
RAISE_INT(DelugeError, "No such unique_ID.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue