{"record":{"id":"ecf28365d90678cc","repo":"nikivdev/code","slug":"exited-with-status-ecf283","errorCode":null,"errorMessage":"{} exited with status {}","messagePattern":"(.+?) exited with status (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/palette.rs","lineNumber":86,"sourceCode":"    let entry = entries.iter().find(|entry| entry.display == selection);\n    Ok(entry.map(|e| FzfResult {\n        entry: e,\n        with_args,\n    }))\n}\n\nfn run_entry(entry: &PaletteEntry, extra_args: Vec<String>) -> Result<()> {\n    let exe = std::env::current_exe().context(\"failed to resolve current executable\")?;\n    let status = Command::new(exe)\n        .args(&entry.exec)\n        .args(&extra_args)\n        .status()\n        .with_context(|| format!(\"failed to run {}\", entry.display))?;\n\n    if status.success() {\n        Ok(())\n    } else {\n        bail!(\n            \"{} exited with status {}\",\n            entry.display,\n            status.code().unwrap_or(-1)\n        );\n    }\n}\n\nfn present(entries: Vec<PaletteEntry>) -> Result<()> {\n    if entries.is_empty() {\n        println!(\"No commands or tasks available. Add entries to flow.toml or global config.\");\n        return Ok(());\n    }\n\n    if which::which(\"fzf\").is_err() {\n        println!(\"fzf not found on PATH – install it to use fuzzy selection.\");\n        println!(\"Available commands:\");\n        for entry in &entries {\n            println!(\"  {}\", entry.display);","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/palette.rs#L68-L104","documentation":"run_entry spawns the palette entry's command via Command::status. If the child process starts but exits with a non-zero status, present's runner reports the failure including the exit code (or -1 when the process was killed by a signal and has no code).","triggerScenarios":"Selecting a palette entry whose command runs and returns non-zero, e.g. a failing test script, or a command killed by a signal (unwrap_or(-1) path).","commonSituations":"Palette entry pointing at a script that fails in the current directory context; a linter/formatter finding issues; command killed by SIGINT/SIGKILL so status.code() is None.","solutions":["Run the entry's command manually to see its real error output and fix the underlying failure.","Update the palette entry definition to point at a working command or correct working directory.","If the code is -1, the process was signal-killed; check for OOM or manual interruption."],"exampleFix":"// before (palette entry)\n{ display: \"build\", command: \"cargo build --features missing\" }\n// exited with status 101\n\n// after\n{ display: \"build\", command: \"cargo build\" }","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = run_entry(entry) {\n    eprintln!(\"palette entry '{}' failed: {}\", entry.display, e);\n    // fall back or surface the child's own stderr\n}","preventionTips":["Test each palette command manually after adding or editing it.","Pin commands with absolute paths and an explicit working directory.","Treat exit code -1 as a signal kill: check for OOM/interruption."],"tags":["process","exit-code","cli"],"backgroundTag":"nonzero-exit-code","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}