mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 00:18:39 +00:00
try to catch unicode error
This commit is contained in:
parent
2ce5d5e35e
commit
74a1f60e42
1 changed files with 10 additions and 6 deletions
16
src/core.py
16
src/core.py
|
@ -727,15 +727,19 @@ Space:") + " " + nice_free)
|
||||||
elif event['event_type'] is self.constants['EVENT_TRACKER_ALERT']:
|
elif event['event_type'] is self.constants['EVENT_TRACKER_ALERT']:
|
||||||
match = re.search('tracker:\s*".*"\s*(.*)', event["message"])
|
match = re.search('tracker:\s*".*"\s*(.*)', event["message"])
|
||||||
message = match and match.groups()[0] or ""
|
message = match and match.groups()[0] or ""
|
||||||
|
try:
|
||||||
tracker_status = "%s: %s (%s=%s, %s=%s)" % \
|
tracker_status = "%s: %s (%s=%s, %s=%s)" % \
|
||||||
(_("Alert"), message,
|
(_("Alert"), message,
|
||||||
_("HTTP code"), event["status_code"],
|
_("HTTP code"), event["status_code"],
|
||||||
_("times in a row"), event["times_in_row"])
|
_("times in a row"), event["times_in_row"])
|
||||||
|
|
||||||
self.set_supp_torrent_state_val(event['unique_ID'],
|
self.set_supp_torrent_state_val(event['unique_ID'],
|
||||||
"tracker_status",
|
"tracker_status",
|
||||||
tracker_status)
|
tracker_status)
|
||||||
|
except Exception, e:
|
||||||
|
print "There was a problem displaying a tracker alert. Most\
|
||||||
|
likely the tracker did not responsd in utf-8.", e
|
||||||
|
|
||||||
elif event['event_type'] is self.constants['EVENT_TRACKER_WARNING']:
|
elif event['event_type'] is self.constants['EVENT_TRACKER_WARNING']:
|
||||||
# Probably will need proper formatting later, not tested yet
|
# Probably will need proper formatting later, not tested yet
|
||||||
tracker_status = '%s: %s' % (_("Warning"), event["message"])
|
tracker_status = '%s: %s' % (_("Warning"), event["message"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue