{"record":{"id":"06752feba4cd7010","repo":"sipeed/picoclaw","slug":"reading-userinfo-response-w","errorCode":null,"errorMessage":"reading userinfo response: %w","messagePattern":"reading userinfo response: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/auth/helpers.go","lineNumber":253,"sourceCode":"}\n\nfunc fetchGoogleUserEmail(accessToken string) (string, error) {\n\treq, err := http.NewRequest(\"GET\", \"https://www.googleapis.com/oauth2/v2/userinfo\", nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+accessToken)\n\n\tclient := &http.Client{Timeout: 10 * time.Second}\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tdefer resp.Body.Close()\n\n\tbody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"reading userinfo response: %w\", err)\n\t}\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", fmt.Errorf(\"userinfo request failed: %s\", string(body))\n\t}\n\n\tvar userInfo struct {\n\t\tEmail string `json:\"email\"`\n\t}\n\tif err := json.Unmarshal(body, &userInfo); err != nil {\n\t\treturn \"\", err\n\t}\n\treturn userInfo.Email, nil\n}\n\nfunc authLoginPasteToken(provider string) error {\n\tcred, err := auth.LoginPasteToken(provider, os.Stdin)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"login failed: %w\", err)","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/auth/helpers.go#L235-L271","documentation":"Error \"reading userinfo response: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at cmd/picoclaw/internal/auth/helpers.go:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}