def _handle_failure(self, failure, ip=None):
"""Logs DNS failures, but does not stop the job from running."""
failtype = failure.trap(error.TimeoutError, defer.TimeoutError,
DomainError)
if failtype in (error.TimeoutError, defer.TimeoutError):
self._logger.warning("DNS lookup timed out")
elif failtype == DomainError:
self._logger.warning("DNS lookup error for %s: %s",
ip, failure.type.__name__)
评论列表
文章目录