{"record":{"id":"c5fe34c34d5f3527","repo":"wtfutil/wtf","slug":"failed-to-parse-query-s","errorCode":null,"errorMessage":" failed to parse query\n %s","messagePattern":" failed to parse query\n (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/pihole/client.go","lineNumber":45,"sourceCode":"\t\t\tHours   FlexInt `json:\"hours\"`\n\t\t\tMinutes FlexInt `json:\"minutes\"`\n\t\t}\n\t} `json:\"gravity_last_updated\"`\n}\n\nfunc getStatus(c http.Client, apiURL string) (status Status, err error) {\n\tvar req *http.Request\n\n\tvar url *url2.URL\n\n\tif url, err = url2.Parse(apiURL); err != nil {\n\t\treturn status, fmt.Errorf(\" failed to parse API URL\\n %s\", parseError(err))\n\t}\n\n\tvar query url2.Values\n\n\tif query, err = url2.ParseQuery(url.RawQuery); err != nil {\n\t\treturn status, fmt.Errorf(\" failed to parse query\\n %s\", parseError(err))\n\t}\n\n\tquery.Add(\"summary\", \"\")\n\n\turl.RawQuery = query.Encode()\n\tif req, err = http.NewRequest(\"GET\", url.String(), http.NoBody); err != nil {\n\t\treturn status, fmt.Errorf(\" failed to create request\\n %s\", parseError(err))\n\t}\n\n\tvar resp *http.Response\n\n\tif resp, err = c.Do(req); err != nil || resp == nil {\n\t\treturn status, fmt.Errorf(\" failed to connect to Pi-hole server\\n %s\", parseError(err))\n\t}\n\n\tdefer func() {\n\t\tif closeErr := resp.Body.Close(); closeErr != nil {\n\t\t\treturn","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/pihole/client.go#L27-L63","documentation":"Raised in getStatus when url2.ParseQuery fails on the raw query portion of the configured Pi-hole API URL — the URL's query string is malformed (e.g. bad percent-encoding or a malformed parameter), so the request cannot be assembled.","triggerScenarios":"Thrown at modules/pihole/client.go:45 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the query string in the configured apiUrl — ensure valid percent-encoding and key=value pairs","Remove or correct malformed URL parameters in the config","Simplify the apiUrl to a base endpoint and let the widget append its own parameters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb838c1ccb0f0f3223690df44afdec663d622881","analyzedAt":"2026-09-03T17:02:45.030Z","contentChangedAt":"2026-09-03T17:02:45.030Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}