Debug geoip errors.

This commit is contained in:
Bastian Kleineidam 2011-05-05 19:42:19 +02:00
parent b3e692ea79
commit 1703e6c942

View file

@ -23,6 +23,7 @@ import socket
from .lock import get_lock
from .decorators import synchronized
from .strformat import unicode_safe
from . import log, LOG_CHECK
# It is unknown if the geoip library is already thread-safe, so
# no risks should be taken here by using a lock.
@ -74,6 +75,7 @@ def get_country (host):
try:
record = get_geoip_record(host)
except (geoip_error, socket.error):
log.debug(LOG_CHECK, "Geoip error for %r", host, exception=True)
# ignore lookup errors
return None
value = u""