7172: more meaningful LOG warning plug/utils.py
This commit is contained in:
parent
3a5b0bca9a
commit
5c467c3bb3
@ -222,14 +222,15 @@ def available_updates():
|
|||||||
(config.get("behavior.addons-url"), lang))
|
(config.get("behavior.addons-url"), lang))
|
||||||
LOG.debug(" trying: %s" % URL)
|
LOG.debug(" trying: %s" % URL)
|
||||||
try:
|
try:
|
||||||
fp = urlopen(URL, timeout=10) # abort after 10 seconds
|
fp = urlopen(URL, timeout=10) # seconds
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
URL = ("%s/listings/addons-%s.txt" %
|
URL = ("%s/listings/addons-%s.txt" %
|
||||||
(config.get("behavior.addons-url"), lang[:2]))
|
(config.get("behavior.addons-url"), lang[:2]))
|
||||||
fp = urlopen(URL, timeout=10)
|
fp = urlopen(URL, timeout=10)
|
||||||
except Exception as err: # some error
|
except Exception as err: # some error
|
||||||
LOG.warn("Failed to open %s: %s" % (lang, err))
|
LOG.warning("Failed to open addon metadata for {lang} {url}: {err}".
|
||||||
|
format(lang=lang, url=URL, err=err))
|
||||||
fp = None
|
fp = None
|
||||||
if fp and fp.getcode() == 200: # ok
|
if fp and fp.getcode() == 200: # ok
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user