mirror of
https://git.deluge-torrent.org/deluge
synced 2025-04-21 12:04:51 +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']:
|
||||
match = re.search('tracker:\s*".*"\s*(.*)', event["message"])
|
||||
message = match and match.groups()[0] or ""
|
||||
|
||||
tracker_status = "%s: %s (%s=%s, %s=%s)" % \
|
||||
(_("Alert"), message,
|
||||
_("HTTP code"), event["status_code"],
|
||||
_("times in a row"), event["times_in_row"])
|
||||
try:
|
||||
tracker_status = "%s: %s (%s=%s, %s=%s)" % \
|
||||
(_("Alert"), message,
|
||||
_("HTTP code"), event["status_code"],
|
||||
_("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)
|
||||
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']:
|
||||
# Probably will need proper formatting later, not tested yet
|
||||
tracker_status = '%s: %s' % (_("Warning"), event["message"])
|
||||
|
|
Loading…
Add table
Reference in a new issue