{"record":{"id":"01012d97fa50a77d","repo":"sipeed/picoclaw","slug":"userinfo-request-failed-s","errorCode":null,"errorMessage":"userinfo request failed: %s","messagePattern":"userinfo request failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/picoclaw/internal/auth/helpers.go","lineNumber":256,"sourceCode":"\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)\n\t}\n\n\tif err = auth.SetCredential(provider, cred); err != nil {","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/cmd/picoclaw/internal/auth/helpers.go#L238-L274","documentation":"Error \"userinfo request failed: %s\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at cmd/picoclaw/internal/auth/helpers.go:256 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"}