{"record":{"id":"aeb2d237f7753969","repo":"google-gemini/gemini-cli","slug":"unexpected-api-client-error-e","errorCode":null,"errorMessage":"Unexpected API client error: {e}","messagePattern":"Unexpected API client error: (.+?)","errorType":"exception","errorClass":"GitHubClientError","httpStatus":null,"severity":"error","filePath":"tools/caretaker-agent/cloudrun/pr-generator/workflow/github_client.py","lineNumber":95,"sourceCode":"            with urllib.request.urlopen(req,timeout=60) as response:\n                response_payload = json.loads(response.read().decode(\"utf-8\"))\n                pr_number: str = str(response_payload.get(\"number\", response_payload.get(\"html_url\", \"\")))\n                logging.info(\n                    \"Pull Request created successfully! PR Number: %s\", pr_number\n                )\n                return pr_number\n        except urllib.error.URLError as e:\n            if isinstance(e, urllib.error.HTTPError):\n                err_body = e.read().decode(\"utf-8\") if e.fp else \"No body content\"\n                err_msg = f\"HTTP {e.code}: {err_body}\"\n            else:\n                err_msg = f\"Network Error: {getattr(e, 'reason', e)}\"\n\n            logging.error(\"Failed to create Pull Request: %s\", err_msg)\n            raise GitHubClientError(f\"GitHub API Error: {err_msg}\") from e\n        except Exception as e:\n            logging.exception(\"Encountered unexpected error during PR creation.\")\n            raise GitHubClientError(\n                f\"Unexpected API client error: {e}\"\n            ) from e\n","sourceCodeStart":77,"sourceCodeEnd":98,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/tools/caretaker-agent/cloudrun/pr-generator/workflow/github_client.py#L77-L98","documentation":"Error \"Unexpected API client error: {e}\" thrown in google-gemini/gemini-cli.","triggerScenarios":"Thrown at tools/caretaker-agent/cloudrun/pr-generator/workflow/github_client.py:95 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":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}