[Core] Handle error when adding torrents to session at startup

This commit is contained in:
bendikro 2016-04-17 21:19:46 +02:00 committed by Calum Lind
parent 47f14845ca
commit 38e0bc1257
1 changed files with 7 additions and 3 deletions

View File

@ -592,9 +592,13 @@ class TorrentManager(component.Component):
if torrent_info:
magnet = None
d = self.add(torrent_info=torrent_info, state=t_state, options=options, save_state=False,
magnet=magnet, resume_data=resume_data.get(t_state.torrent_id))
deferreds.append(d)
try:
d = self.add(torrent_info=torrent_info, state=t_state, options=options, save_state=False,
magnet=magnet, resume_data=resume_data.get(t_state.torrent_id))
except AddTorrentError as ex:
log.warn("Error when adding torrent '%s' to session: %s", t_state.torrent_id, ex)
else:
deferreds.append(d)
deferred_list = DeferredList(deferreds, consumeErrors=False)