{"record":{"id":"1d8ed6f473f572a7","repo":"Hmbown/CodeWhale","slug":"failed-to-read-patch","errorCode":null,"errorMessage":"Failed to read patch {}: {}","messagePattern":"Failed to read patch (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":8310,"sourceCode":"        .as_deref()\n        .map(str::trim)\n        .filter(|base| !base.is_empty())\n    {\n        format!(\"base:{base}\")\n    } else {\n        \"working-tree\".to_string()\n    };\n    if let Some(path) = &args.path {\n        label.push(' ');\n        label.push_str(path.to_string_lossy().as_ref());\n    }\n    label\n}\n\nfn run_apply(args: ApplyArgs) -> Result<()> {\n    let patch = if let Some(path) = args.patch_file {\n        std::fs::read_to_string(&path)\n            .map_err(|e| anyhow::anyhow!(\"Failed to read patch {}: {}\", path.display(), e))?\n    } else {\n        read_patch_from_stdin()?\n    };\n    if patch.trim().is_empty() {\n        bail!(\"Patch is empty.\");\n    }\n\n    let mut tmp = NamedTempFile::new()?;\n    tmp.write_all(patch.as_bytes())?;\n    let tmp_path = tmp.path().to_path_buf();\n\n    let output = crate::dependencies::Git::command()\n        .ok_or_else(|| anyhow::anyhow!(\"git not found on PATH\"))?\n        .arg(\"apply\")\n        .arg(\"--whitespace=nowarn\")\n        .arg(&tmp_path)\n        .output()\n        .map_err(|e| anyhow::anyhow!(\"Failed to run git apply: {e}\"))?;","sourceCodeStart":8292,"sourceCodeEnd":8328,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/lib.rs#L8292-L8328","documentation":"Error \"Failed to read patch {}: {}\" thrown in Hmbown/CodeWhale.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:8310 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":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}