{"record":{"id":"ceacf1e27214344e","repo":"glanceapp/glance","slug":"initializing-request-v","errorCode":null,"errorMessage":"initializing request: %v","messagePattern":"initializing request: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/glance/widget-custom-api.go","lineNumber":665,"sourceCode":"\t\t\treq.Headers[key] = value\n\t\t\treturn req\n\t\t},\n\t\t\"withParameter\": func(key, value string, req *CustomAPIRequest) *CustomAPIRequest {\n\t\t\tif req.Parameters == nil {\n\t\t\t\treq.Parameters = make(queryParametersField)\n\t\t\t}\n\t\t\treq.Parameters[key] = append(req.Parameters[key], value)\n\t\t\treturn req\n\t\t},\n\t\t\"withStringBody\": func(body string, req *CustomAPIRequest) *CustomAPIRequest {\n\t\t\treq.Body = body\n\t\t\treq.BodyType = \"string\"\n\t\t\treturn req\n\t\t},\n\t\t\"getResponse\": func(req *CustomAPIRequest) *customAPIResponseData {\n\t\t\terr := req.initialize()\n\t\t\tif err != nil {\n\t\t\t\tpanic(fmt.Sprintf(\"initializing request: %v\", err))\n\t\t\t}\n\n\t\t\tdata, err := fetchCustomAPIResponse(context.Background(), req)\n\t\t\tif err != nil {\n\t\t\t\tslog.Error(\"Could not fetch response within custom API template\", \"error\", err)\n\t\t\t\treturn &customAPIResponseData{\n\t\t\t\t\tJSON: decoratedGJSONResult{gjson.Result{}},\n\t\t\t\t\tResponse: &http.Response{\n\t\t\t\t\t\tStatus: err.Error(),\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data\n\t\t},\n\t}\n\n\tfor key, value := range globalTemplateFunctions {","sourceCodeStart":647,"sourceCodeEnd":683,"githubUrl":"https://github.com/glanceapp/glance/blob/91324e8de762702e97b0ac5c8e36271d644d8642/internal/glance/widget-custom-api.go#L647-L683","documentation":"Error \"initializing request: %v\" thrown in glanceapp/glance.","triggerScenarios":"Occurs when building an HTTP request for the custom-api widget fails, e.g. an invalid URL, invalid header value, or unsupported method.","commonSituations":"A malformed URL in the widget config, headers containing illegal characters, or a template producing an invalid URL at runtime.","solutions":["Fix the request built inside the custom-api template via 'newRequest'/'withURL'/etc.: provide a valid URL and valid headers/parameters.","Check the underlying initialization error included in the message (e.g. URL parsing) and correct the corresponding template call."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"91324e8de762702e97b0ac5c8e36271d644d8642","analyzedAt":"2026-08-15T14:12:54.279Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}