Catch RuntimeErrors in load_torrent(). These are likely due to bad
torrent files.
This commit is contained in:
parent
38f0d9f71c
commit
a55dcc8099
|
@ -152,6 +152,9 @@ class TorrentManager(component.Component):
|
||||||
else:
|
else:
|
||||||
# Get the data from the file
|
# Get the data from the file
|
||||||
filedump = self.load_torrent(filename)
|
filedump = self.load_torrent(filename)
|
||||||
|
if not filedump:
|
||||||
|
log.warning("Unable to load torrent file..")
|
||||||
|
return None
|
||||||
|
|
||||||
# Attempt to load fastresume data
|
# Attempt to load fastresume data
|
||||||
try:
|
try:
|
||||||
|
@ -288,7 +291,7 @@ class TorrentManager(component.Component):
|
||||||
"rb")
|
"rb")
|
||||||
filedump = lt.bdecode(_file.read())
|
filedump = lt.bdecode(_file.read())
|
||||||
_file.close()
|
_file.close()
|
||||||
except IOError, e:
|
except (IOError, RuntimeError), e:
|
||||||
log.warning("Unable to open %s: e", filename, e)
|
log.warning("Unable to open %s: e", filename, e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue