{"record":{"id":"1793e5acecf83852","repo":"Hmbown/CodeWhale","slug":"failed-to-run-gh-repo-view-e","errorCode":null,"errorMessage":"Failed to run `gh repo view`: {e}","messagePattern":"Failed to run `gh repo view`: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":9310,"sourceCode":"    }\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\")\n        .arg(\".nameWithOwner\");\n    let output = cmd\n        .output()\n        .map_err(|e| anyhow::anyhow!(\"Failed to run `gh repo view`: {e}\"))?;\n    if !output.status.success() {\n        let stderr = String::from_utf8_lossy(&output.stderr).trim().to_string();\n        bail!(\"gh repo view failed: {stderr}\");\n    }\n    let name = String::from_utf8_lossy(&output.stdout).trim().to_string();\n    if name.is_empty() {\n        bail!(\"`gh repo view` returned an empty repository name\");\n    }\n    Ok(name)\n}\n\n/// Pick a fence long enough to wrap `replacement` without the replacement's\n/// own backticks closing the block early.\nfn suggestion_fence(replacement: &str) -> String {\n    let mut longest = 0usize;\n    let mut run = 0usize;\n    for ch in replacement.chars() {\n        if ch == '`' {","sourceCodeStart":9292,"sourceCodeEnd":9328,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/lib.rs#L9292-L9328","documentation":"run_gh_repo_name wraps a failing `gh repo view --json nameWithOwner`; repository resolution for `gh api` calls failed — not a repo, no auth, or gh could not infer owner/name from the working directory.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:9310 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the io error detail in {e}; typical causes are gh not authenticated or no network.","Run `gh repo view` manually in the workspace to confirm gh can infer the repository."],"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"}