{"record":{"id":"c0acef5668129aea","repo":"Tencent/WeKnora","slug":"paddleocr-vl-error-d-s","errorCode":null,"errorMessage":"PaddleOCR-VL error %d: %s","messagePattern":"PaddleOCR-VL error (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_converter.go","lineNumber":187,"sourceCode":"\t\treturn \"\", nil, fmt.Errorf(\"HTTP request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"read response body: %w\", err)\n\t}\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", nil, fmt.Errorf(\"PaddleOCR-VL API status %d: %s\", resp.StatusCode, string(respBody))\n\t}\n\n\tvar result paddleOCRVLResponse\n\tif err := json.Unmarshal(respBody, &result); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"decode response: %w\", err)\n\t}\n\tif result.ErrorCode != 0 {\n\t\treturn \"\", nil, fmt.Errorf(\"PaddleOCR-VL error %d: %s\", result.ErrorCode, result.ErrorMsg)\n\t}\n\n\tpages := result.Result.LayoutParsingResults\n\tif len(pages) == 0 {\n\t\tlogger.Errorf(context.Background(), \"[PaddleOCR-VL] response has no layoutParsingResults\")\n\t\treturn \"\", nil, nil\n\t}\n\n\t// Merge per-page markdown and image dicts into one document.\n\ttexts := make([]string, 0, len(pages))\n\timages := make(map[string]string)\n\tfor _, p := range pages {\n\t\tif t := strings.TrimSpace(p.Markdown.Text); t != \"\" {\n\t\t\ttexts = append(texts, p.Markdown.Text)\n\t\t}\n\t\tfor path, data := range p.Markdown.Images {\n\t\t\tif _, ok := images[path]; !ok {\n\t\t\t\timages[path] = data","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_converter.go#L169-L205","documentation":"The PaddleOCR-VL API responded successfully but reported a non-zero ErrorCode in callLayoutParsing; the code and message are embedded and represent application-level failures such as unsupported fileType or OCR processing errors.","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_converter.go:187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Match the embedded ErrorCode against PaddleOCR-VL docs","Correct fileType/engine parameters as indicated","Resubmit if the error is transient on the service side"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}