From 38e0bc125737b7d7c30c1074121a87dec52215b1 Mon Sep 17 00:00:00 2001 From: bendikro Date: Sun, 17 Apr 2016 21:19:46 +0200 Subject: [PATCH] [Core] Handle error when adding torrents to session at startup --- deluge/core/torrentmanager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index e4730347a..412d3553c 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -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)