summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-11-26 04:48:11 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-11-26 04:48:11 +0000
commit8f6bb96df00496f93d5c74c348861188e9f854b3 (patch)
tree5a0096714cd16dfdac4100ca01156f2ecf6f6384
parent32fc9bbf075005980b17a1fc88b8b692c3545467 (diff)
downloaddeluge-8f6bb96df00496f93d5c74c348861188e9f854b3.tar.gz
deluge-8f6bb96df00496f93d5c74c348861188e9f854b3.tar.bz2
deluge-8f6bb96df00496f93d5c74c348861188e9f854b3.zip
add catch to get_index_from_unique_id
-rw-r--r--src/deluge_core.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/deluge_core.cpp b/src/deluge_core.cpp
index 06f2f45cd..0a350f7c6 100644
--- a/src/deluge_core.cpp
+++ b/src/deluge_core.cpp
@@ -181,11 +181,19 @@ long get_torrent_index(torrent_handle &handle)
long get_index_from_unique_ID(long unique_ID)
{
-
+ try{
for (unsigned long i = 0; i < M_torrents->size(); i++)
if ((*M_torrents)[i].unique_ID == unique_ID)
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.");
}