{"record":{"id":"b097faa2c1a8c9b6","repo":"Tencent/WeKnora","slug":"http-new-request-w-b097fa","errorCode":null,"errorMessage":"http new request: %w","messagePattern":"http new request: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/infrastructure/docparser/weknoracloud_http_reader.go","lineNumber":233,"sourceCode":"\t\t\t// Update interval for next iteration\n\t\t\tnextInterval := time.Duration(float64(currentInterval) * 1.5)\n\t\t\tif nextInterval > p.maxPollInterval {\n\t\t\t\tnextInterval = p.maxPollInterval\n\t\t\t}\n\t\t\tcurrentInterval = nextInterval\n\t\t}\n\t}\n}\n\nfunc (p *WeKnoraCloudSignedDocumentReader) newSignedRequest(ctx context.Context, method, url string, body []byte) (*http.Request, error) {\n\trequestID := uuid.New().String()\n\tif len(body) == 0 {\n\t\tbody = []byte(\"{}\")\n\t}\n\thttpReq, err := http.NewRequestWithContext(ctx, method, url, bytes.NewReader(body))\n\tif err != nil {\n\t\tlogger.Errorf(context.Background(), \"[WeKnoraCloud] http new request %s %s: %v\", method, url, err)\n\t\treturn nil, fmt.Errorf(\"http new request: %w\", err)\n\t}\n\thttpReq.Header.Set(\"Content-Type\", \"application/json\")\n\thttpReq.ContentLength = int64(len(body))\n\tfor k, v := range utils.Sign(p.appID, p.apiKey, requestID, string(body)) {\n\t\thttpReq.Header.Set(k, v)\n\t}\n\treturn httpReq, nil\n}\n","sourceCodeStart":215,"sourceCodeEnd":242,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/infrastructure/docparser/weknoracloud_http_reader.go#L215-L242","documentation":"Fired in newSignedRequest when http.NewRequestWithContext cannot construct the request — almost always because the URL string is malformed (unparseable scheme/host) or the context is already cancelled. Called by both Read and pollTaskResult.","triggerScenarios":"Thrown at internal/infrastructure/docparser/weknoracloud_http_reader.go:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the endpoint URL constant/configuration parses as a valid URL","Check whether the passed context was already cancelled","This is a programming/config error; fix the URL rather than retry"],"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"}