mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 16:38:43 +00:00
Check for invalid handle on tracker errors/warnings
This commit is contained in:
parent
0204ba426a
commit
5c35712800
1 changed files with 11 additions and 2 deletions
|
@ -704,7 +704,11 @@ class TorrentManager(component.Component):
|
||||||
def on_alert_tracker_warning(self, alert):
|
def on_alert_tracker_warning(self, alert):
|
||||||
log.debug("on_alert_tracker_warning")
|
log.debug("on_alert_tracker_warning")
|
||||||
# Get the torrent_id
|
# Get the torrent_id
|
||||||
torrent_id = str(alert.handle.info_hash())
|
try:
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
|
except RuntimeError:
|
||||||
|
log.debug("Invalid torrent handle.")
|
||||||
|
return
|
||||||
tracker_status = '%s: %s' % (_("Warning"), str(alert.message()))
|
tracker_status = '%s: %s' % (_("Warning"), str(alert.message()))
|
||||||
# Set the tracker status for the torrent
|
# Set the tracker status for the torrent
|
||||||
try:
|
try:
|
||||||
|
@ -714,7 +718,12 @@ class TorrentManager(component.Component):
|
||||||
|
|
||||||
def on_alert_tracker_error(self, alert):
|
def on_alert_tracker_error(self, alert):
|
||||||
log.debug("on_alert_tracker_error")
|
log.debug("on_alert_tracker_error")
|
||||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
try:
|
||||||
|
torrent_id = str(alert.handle.info_hash())
|
||||||
|
except RuntimeError:
|
||||||
|
log.debug("Invalid torrent handle.")
|
||||||
|
return
|
||||||
|
torrent = self.torrents[torrent_id]
|
||||||
tracker_status = "%s: %s" % (_("Error"), alert.msg)
|
tracker_status = "%s: %s" % (_("Error"), alert.msg)
|
||||||
try:
|
try:
|
||||||
torrent.set_tracker_status(tracker_status)
|
torrent.set_tracker_status(tracker_status)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue