{"record":{"id":"b9033cc69321d987","repo":"Tencent/WeKnora","slug":"decode-response-w-b9033c","errorCode":null,"errorMessage":"decode response: %w","messagePattern":"decode response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_converter.go","lineNumber":184,"sourceCode":"\t})\n\tresp, err := client.Do(httpReq)\n\tif err != nil {\n\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}","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_converter.go#L166-L202","documentation":"Deserialization error in PaddleOCRVLReader.callLayoutParsing: the 200 response body could not be unmarshaled into paddleOCRVLResponse. The %w wraps the JSON error, indicating the PaddleOCR-VL service returned a schema the client cannot parse; the ErrorCode check follows only after successful decode.","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_converter.go:184 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log a body snippet to inspect the actual payload","Check for proxies rewriting responses","Verify the PaddleOCR-VL API contract version"],"exampleFix":null,"handlingStrategy":"try-catch","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"}