{"record":{"id":"3b917946bb322629","repo":"zed-industries/zed","slug":"fatal-error","errorCode":null,"errorMessage":"Fatal error: {:?}","messagePattern":"Fatal error: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/main.rs","lineNumber":1583,"sourceCode":"                        let examples = finished_examples.lock().unwrap();\n                        repair::print_report(&examples, args.confidence_threshold);\n                    }\n                    _ => (),\n                };\n\n                // For --in-place, atomically rename temp file to original\n                if let Some(temp_path) = &in_place_temp_path {\n                    let final_path = output.as_ref().expect(\"in_place_temp_path requires output\");\n                    std::fs::rename(temp_path, final_path)\n                        .expect(\"Failed to rename temp file to final output\");\n                }\n\n                anyhow::Ok(())\n            }\n            .await;\n\n            if let Err(e) = result {\n                panic!(\"Fatal error: {:?}\", e);\n            }\n\n            let _ = cx.update(|cx| cx.quit());\n        })\n        .detach();\n    });\n}\n\nfn rewrite_output(\n    examples: &[Example],\n    output_path: Option<&PathBuf>,\n    markdown: bool,\n) -> anyhow::Result<()> {\n    if markdown {\n        let dir = output_path.context(\"--markdown requires -o\")?;\n        for example in examples {\n            let filename = format!(\"{}.md\", example.spec.filename());\n            let path = dir.join(&filename);","sourceCodeStart":1565,"sourceCodeEnd":1601,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/main.rs#L1565-L1601","documentation":"The command's async body produces an `anyhow::Result`; when it completes with Err, the CLI panics with 'Fatal error: {:?}' wrapping the error. The panic itself carries no new information — it is the terminal surfacing of an earlier operational failure (I/O, provider request, parsing) whose real cause is printed inside the panic message.","triggerScenarios":"Any failure inside the command's run loop: unreadable input paths, provider/network errors while fetching predictions or context, malformed example files, or failures writing the output file.","commonSituations":"Invalid --inputs path, expired tokens or provider outages mid-run, disk full when writing results, or network interruption while cloning/fetching repos.","solutions":["Read the wrapped error in the panic payload — it names the actual failing operation","Fix that underlying cause (correct path, credentials, connectivity, disk space)","Re-run the command; use --fresh only if stale intermediate state is implicated"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// shell: sanity-check inputs before the (long) run\nfor f in \"${INPUTS[@]}\"; do test -e \"$f\" || { echo \"missing input: $f\"; exit 1; }; done","typeGuard":null,"tryCatchPattern":"try {\n    command.run()\n} catch (err) {\n    // panic payload 'Fatal error: {:?}' wraps the anyhow chain;\n    // log err.cause chain and retry only transient causes (network)\n    report(err.cause ?? err);\n}","preventionTips":["Verify input paths and provider credentials before starting long runs","Treat the panic payload as an error report: the real cause is inside the Debug print","Run with logging enabled so the failing operation is visible before the panic"],"tags":["edit-prediction-cli","fatal-error","anyhow","panic"],"backgroundTag":"command-execution-failed","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}