def _handle_error(self, failure):
"""Handle errors in connecting or resolving."""
log.err(failure)
error_code = 1
if failure.check(DNSLookupError):
error_code = 4
if failure.check(ConnectionRefusedError):
error_code = 5
self._write_response(error_code, "0.0.0.0", 0)
评论列表
文章目录