{"record":{"id":"2c31bd7399dc46ea","repo":"XX-net/XX-Net","slug":"check-except-r","errorCode":null,"errorMessage":"check except:%r","messagePattern":"check except:%r","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"code/default/gae_proxy/local/check_ip.py","lineNumber":136,"sourceCode":"                    continue\n\n    def write_ip(self, ip, host, handshake):\n        with self.lock:\n            self.out_fd.write(\"%s %s gws %d 0 0\\n\" % (ip, host, handshake))\n            self.out_fd.flush()\n\n    def checker(self):\n        while True:\n            try:\n                ip = self.get_ip()\n            except Exception as e:\n                xlog.info(\"no ip left\")\n                return\n\n            try:\n                res = self.check_ip.check_ip(ip)\n            except Exception as e:\n                xlog.warn(\"check except:%r\", e)\n                continue\n\n            if not res or not res.ok:\n                xlog.debug(\"ip:%s fail\", ip)\n                continue\n\n            if res.h2:\n                self.write_ip(ip, res.domain, res.handshake_time)\n\n    def run(self):\n        for i in range(0, 100):\n            threading.Thread(target=self.checker, name=\"gae_ip_checker\").start()\n\n\ndef check_all():\n    check = CheckAllIp()\n    check.run()\n    exit(0)","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/XX-net/XX-Net/blob/cfa5bc17b67676e467f37ec50766127e0ab5f0aa/code/default/gae_proxy/local/check_ip.py#L118-L154","documentation":"Checker thread caught an unexpected exception while calling check_ip(ip) for a candidate IP; the IP is skipped (continue) and the loop moves on. This guards the IP-scan loop from crashing.","triggerScenarios":"Any exception escaping check_ip beyond expected failures: DNS/socket edge cases, SSL errors, or coding bugs in the checker for malformed IPs.","commonSituations":"Odd network conditions during mass IP scanning, library incompatibilities, or malformed IP entries in the candidate list.","solutions":["Check the %r exception detail in logs; single skips during scanning are normal","Update XX-Net for checker fixes","If every IP raises, investigate environment (openssl version, DNS) rather than the IPs","Sanitize custom IP ranges you add to the scan list"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    res = self.check_ip.check_ip(ip)\nexcept Exception:\n    continue  # skip this IP, keep scanning","preventionTips":["Wrap per-IP checks in try/except inside scan loops","Sanitize custom IP inputs","Update the checker with the app version"],"tags":["gae-proxy","ip-scan","exception"],"backgroundTag":"health-check-request-failed","analyzedSha":"cfa5bc17b67676e467f37ec50766127e0ab5f0aa","analyzedAt":"2026-08-27T19:28:28.225Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}