{"record":{"id":"42470db7e1c351ca","repo":"Hmbown/CodeWhale","slug":"failed-to-run-gh-pr-checkout-e","errorCode":null,"errorMessage":"Failed to run `gh pr checkout`: {e}","messagePattern":"Failed to run `gh pr checkout`: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":9288,"sourceCode":"\nfn run_gh_pr_view(number: u32, repo: Option<&str>) -> Result<GhPullRequest> {\n    crate::tools::review_pr::fetch_view(number, repo, &std::env::current_dir()?)\n}\n\nfn run_gh_pr_diff(number: u32, repo: Option<&str>, view: &GhPullRequest) -> Result<String> {\n    crate::tools::review_pr::fetch_diff(number, repo, &std::env::current_dir()?, view)\n}\n\nfn run_gh_pr_checkout(number: u32, repo: Option<&str>) -> Result<()> {\n    let mut cmd = crate::dependencies::Gh::command()\n        .ok_or_else(|| anyhow::anyhow!(\"gh not found on PATH\"))?;\n    cmd.arg(\"pr\").arg(\"checkout\").arg(number.to_string());\n    if let Some(r) = repo {\n        cmd.arg(\"--repo\").arg(r);\n    }\n    let output = cmd\n        .output()\n        .map_err(|e| anyhow::anyhow!(\"Failed to run `gh pr checkout`: {e}\"))?;\n    if !output.status.success() {\n        let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();\n        bail!(\"gh pr checkout #{number} failed: {stderr}\");\n    }\n    Ok(())\n}\n\n/// Resolve the `owner/name` repository `gh` believes the current workspace\n/// belongs to. `gh api` needs an explicit repository path, unlike `gh pr`\n/// which infers it from the working directory.\nfn run_gh_repo_name() -> Result<String> {\n    let mut cmd = crate::dependencies::Gh::command()\n        .ok_or_else(|| anyhow::anyhow!(\"gh not found on PATH\"))?;\n    cmd.arg(\"repo\")\n        .arg(\"view\")\n        .arg(\"--json\")\n        .arg(\"nameWithOwner\")\n        .arg(\"--jq\")","sourceCodeStart":9270,"sourceCodeEnd":9306,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L9270-L9306","documentation":"Subprocess wrapper guard in run_gh_pr_checkout: `gh` was found and the `pr checkout` command was spawned, but the process itself could not run to completion (spawn/exec failure reported as {e}). No checkout occurred.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:9288 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the underlying io error in {e} (permissions, exec format, resource limits) and fix it.","Retry after verifying `gh pr checkout <n>` works from a shell in the same directory."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}