{"record":{"id":"5a2d2c4968547cc7","repo":"Hmbown/CodeWhale","slug":"gh-not-found-on-path","errorCode":null,"errorMessage":"gh not found on PATH","messagePattern":"gh not found on PATH","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":9281,"sourceCode":"            }\n        }\n    }\n    false\n}\n\nuse crate::tools::review_pr::GhPullRequest;\n\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> {","sourceCodeStart":9263,"sourceCodeEnd":9299,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L9263-L9299","documentation":"Dependency guard on the GitHub CLI path: crate::dependencies::Gh::command() returned None, meaning the `gh` executable was not found on PATH. It fires before any `gh pr` subprocess is spawned, so no network or repository access happened.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:9281 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the GitHub CLI (https://cli.github.com/) and ensure `gh` is on PATH.","Point PATH at the directory containing gh and re-run the command."],"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"}