{"record":{"id":"76ac2ffb9d05428f","repo":"wtfutil/wtf","slug":"server-responded-with-d-s-url-s","errorCode":null,"errorMessage":"server responded with [%d]:%s,url:%s","messagePattern":"server responded with \\[(.+?)\\]:(.+?),url:(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/pocket/client.go","lineNumber":104,"sourceCode":"\tfor key, value := range req.headers {\n\t\trequest.Header.Add(key, value)\n\t}\n\trequest.Header.Set(\"User-Agent\", \"wtfutil (https://github.com/wtfutil/wtf)\")\n\n\tresp, err := http.DefaultClient.Do(request)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\n\tresponseBody, err := io.ReadAll(resp.Body)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\tif resp.StatusCode >= 400 {\n\t\treturn fmt.Errorf(`server responded with [%d]:%s,url:%s`, resp.StatusCode, responseBody, req.url)\n\t}\n\n\tif err := json.Unmarshal(responseBody, &result); err != nil {\n\t\treturn fmt.Errorf(\"could not unmarshal url [%s] \\n\\t\\tresponse [%s] error:%w\",\n\t\t\treq.url, responseBody, err)\n\t}\n\n\treturn nil\n\n}\n\ntype obtainRequestTokenRequest struct {\n\tConsumerKey string `json:\"consumer_key\"`\n\tRedirectURI string `json:\"redirect_uri\"`\n}\n\n// ObtainRequestToken get request token to be used in the auth workflow\nfunc (client *Client) ObtainRequestToken() (code string, err error) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/wtfutil/wtf/blob/bb838c1ccb0f0f3223690df44afdec663d622881/modules/pocket/client.go#L86-L122","documentation":"Raised in the Pocket client's request helper when the Pocket API responds with HTTP status >= 400: the error includes the status code, the raw response body, and the request URL. Fires for invalid consumer key, expired/invalid access token (401/403), rate limits, or server errors across all Pocket operations (token exchange, fetching and modifying links).","triggerScenarios":"Thrown at modules/pocket/client.go:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the Pocket authorization flow to obtain a fresh access token (delete the stale pocket.data)","Verify the consumer key configured for the widget is valid","Inspect the response body in the error — Pocket returns an X-Error-Code and explanation","Back off if the status indicates rate limiting (429)"],"exampleFix":null,"handlingStrategy":"fallback","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"}