mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 20:14:13 +00:00
Catch a couple more exceptions.
This commit is contained in:
parent
f39e3c69a3
commit
37fcf4ec4d
@ -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…
x
Reference in New Issue
Block a user