{"record":{"id":"52527658de906068","repo":"Tencent/WeKnora","slug":"decode-response-w-525276","errorCode":null,"errorMessage":"decode response: %w","messagePattern":"decode response: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go","lineNumber":159,"sourceCode":"\t}\n\thttpReq.Header.Set(\"Authorization\", \"bearer \"+c.token)\n\thttpReq.Header.Set(\"Content-Type\", writer.FormDataContentType())\n\n\tclient := utils.NewSSRFSafeHTTPClient(utils.SSRFSafeHTTPClientConfig{Timeout: 60 * time.Second, MaxRedirects: 5})\n\tresp, err := client.Do(httpReq)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"HTTP request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\trespBody, _ := io.ReadAll(resp.Body)\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"API status %d: %s\", resp.StatusCode, string(respBody))\n\t}\n\n\tvar result paddleOCRVLCloudSubmitResponse\n\tif err := json.Unmarshal(respBody, &result); err != nil {\n\t\treturn \"\", fmt.Errorf(\"decode response: %w\", err)\n\t}\n\tif result.Data.JobID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"API returned no jobId: %s\", string(respBody))\n\t}\n\n\tlogger.Infof(context.Background(), \"[PaddleOCR-VL Cloud] job submitted: jobId=%s\", result.Data.JobID)\n\treturn result.Data.JobID, nil\n}\n\n// --- polling ---\n\ntype paddleOCRVLCloudPollResponse struct {\n\tData struct {\n\t\tState           string `json:\"state\"`\n\t\tErrorMsg        string `json:\"errorMsg\"`\n\t\tExtractProgress struct {\n\t\t\tTotalPages     int `json:\"totalPages\"`\n\t\t\tExtractedPages int `json:\"extractedPages\"`","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go#L141-L177","documentation":"Deserialization error in PaddleOCRVLCloudReader.submitJob: the response body could not be unmarshaled into paddleOCRVLCloudSubmitResponse. The %w wraps the JSON error, indicating the cloud OCR API returned an unexpected or malformed schema for the job submission reply.","triggerScenarios":"Thrown at internal/infrastructure/docparser/paddleocr_vl_cloud_converter.go:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Log a body snippet of the unexpected payload","Check for proxies altering responses","Verify the cloud API response schema 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"}