mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 12:04:51 +00:00
Catch RuntimeErrors in load_torrent(). These are likely due to bad
torrent files.
This commit is contained in:
parent
38f0d9f71c
commit
a55dcc8099
1 changed files with 4 additions and 1 deletions
|
@ -152,6 +152,9 @@ class TorrentManager(component.Component):
|
|||
else:
|
||||
# Get the data from the file
|
||||
filedump = self.load_torrent(filename)
|
||||
if not filedump:
|
||||
log.warning("Unable to load torrent file..")
|
||||
return None
|
||||
|
||||
# Attempt to load fastresume data
|
||||
try:
|
||||
|
@ -288,7 +291,7 @@ class TorrentManager(component.Component):
|
|||
"rb")
|
||||
filedump = lt.bdecode(_file.read())
|
||||
_file.close()
|
||||
except IOError, e:
|
||||
except (IOError, RuntimeError), e:
|
||||
log.warning("Unable to open %s: e", filename, e)
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue