{"record":{"id":"9abc87905151ae6c","repo":"jeecgboot/JeecgBoot","slug":"error-9abc87","errorCode":null,"errorMessage":"网页解析失败: ","messagePattern":"网页解析失败: ","errorType":"exception","errorClass":"JeecgBootException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/EmbeddingHandler.java","lineNumber":788,"sourceCode":"\n        Matcher matcher = LLMConsts.WEB_PATTERN.matcher(website);\n        if (!matcher.matches()) {\n            throw new JeecgBootException(\"网页URL格式不正确，请以http://或https://开头\");\n        }\n\n        try {\n            WebPageParser webPageParser = new WebPageParser();\n            String content = webPageParser.parseToMarkdown(website);\n            if (oConvertUtils.isEmpty(content)) {\n                throw new JeecgBootException(\"网页内容为空，请检查URL是否可访问\");\n            }\n            log.info(\"网页解析成功, URL: {}, 内容长度: {}\", website, content.length());\n            return content;\n        } catch (JeecgBootException e) {\n            throw e;\n        } catch (Exception e) {\n            log.error(\"网页解析失败, URL: {}, 错误: {}\", website, e.getMessage(), e);\n            throw new JeecgBootException(\"网页解析失败: \" + e.getMessage());\n        }\n    }\n\n    /**\n     * 解析文件\n     *\n     * @param doc\n     * @author chenrui\n     * @date 2025/3/5 11:31\n     */\n    private String parseFile(AiragKnowledgeDoc doc) {\n        String metadata = doc.getMetadata();\n        AssertUtils.assertNotEmpty(\"请先上传文件\", metadata);\n        JSONObject metadataJson = JSONObject.parseObject(metadata);\n        if (!metadataJson.containsKey(LLMConsts.KNOWLEDGE_DOC_METADATA_FILEPATH)) {\n            throw new JeecgBootException(\"请先上传文件\");\n        }\n        String filePath = metadataJson.getString(LLMConsts.KNOWLEDGE_DOC_METADATA_FILEPATH);","sourceCodeStart":770,"sourceCodeEnd":806,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/EmbeddingHandler.java#L770-L806","documentation":"Thrown by EmbeddingHandler.parseWebPage() as a catch-all for any non-JeecgBootException during web page parsing. JeecgBootExceptions (errors 106, 107) are re-thrown as-is; all other exceptions are caught, logged, and wrapped with the original message. This covers network errors, parsing exceptions, and timeout failures.","triggerScenarios":"WebPageParser.parseToMarkdown() throws an IOException (connection refused, DNS failure, socket timeout), a malformed-URL exception, an HTML parse exception, or any RuntimeException during content extraction. The original exception's message is appended to '网页解析失败: '.","commonSituations":"Target website is down or unreachable; DNS resolution fails for the domain; connection times out; SSL/TLS handshake fails for https URLs; the HTML is malformed causing the parser to throw; firewall blocks outbound HTTP from the server.","solutions":["Check the error message after '网页解析失败: ' — it contains the original exception's message identifying the root cause.","Verify the server can reach the target URL (test with curl from the application host).","For SSL errors, verify the target site's certificate is valid and the Java trust store includes the CA.","For timeout errors, check network latency and firewall rules."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    String content = parseWebPage(doc);\n} catch (JeecgBootException e) {\n    if (e.getMessage().startsWith(\"网页解析失败\")) {\n        log.error(\"Web page parsing failed for doc: {}\", doc.getId(), e);\n        throw new JeecgBootException(\"网页解析失败，请检查URL是否可访问及网络连接\");\n    }\n    throw e;\n}","preventionTips":["Test URL accessibility from the application server before adding to the knowledge base.","Ensure the server's network allows outbound HTTP/HTTPS to the target domain.","Check SSL certificate validity for https URLs."],"tags":["web-parsing","network","rag"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}