Catch RuntimeErrors in load_torrent(). These are likely due to bad

torrent files.
This commit is contained in:
Andrew Resch 2008-01-26 07:10:39 +00:00
parent 38f0d9f71c
commit a55dcc8099
1 changed files with 4 additions and 1 deletions

View File

@ -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