Catch a couple more exceptions.

This commit is contained in:
Andrew Resch 2008-04-07 21:10:44 +00:00
parent f39e3c69a3
commit 37fcf4ec4d
2 changed files with 7 additions and 2 deletions

View File

@ -213,7 +213,12 @@ class TorrentManager(component.Component):
self.config["torrentfiles_location"],
filename + ".fastresume"),
"rb")
fastresume = lt.bdecode(_file.read())
try:
fastresume = lt.bdecode(_file.read())
except RuntimeError, e:
log.warning("Unable to bdecode fastresume file: %s", e)
fastresume = None
_file.close()
except IOError, e:
log.debug("Unable to load .fastresume: %s", e)

View File

@ -229,7 +229,7 @@ class TorrentQueue(component.Component):
try:
value = self.queue[position]
except KeyError:
except KeyError, IndexError:
self.queue.insert(position, torrent_id)
return position