mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 03:54:50 +00:00
Catch a couple more exceptions.
This commit is contained in:
parent
f39e3c69a3
commit
37fcf4ec4d
2 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue