nikivdev/code · error
{}
Error message
{} What it means
In the batch operation loop, when an operation result reports ok=false and continue_on_error is not set, the stored per-item error string is re-bailed so the whole batch aborts. The message is the raw underlying error from the failed operation.
Source
Thrown at src/repos.rs:767
repo_root: entry.path.display().to_string(),
ok: true,
error: None,
bootstrap: Some(bootstrap),
},
Err(err) => HomeBranchMigrationResult {
repo_root: entry.path.display().to_string(),
ok: false,
error: Some(err.to_string()),
bootstrap: None,
},
};
if !result.ok && !opts.continue_on_error {
if opts.json {
println!("{}", serde_json::to_string_pretty(&result)?);
}
if let Some(error) = result.error {
bail!("{}", error);
}
}
results.push(result);
}
if opts.json {
println!("{}", serde_json::to_string_pretty(&results)?);
} else {
for result in &results {
if result.ok {
if let Some(bootstrap) = result.bootstrap.as_ref() {
print_home_branch_bootstrap_result(bootstrap);
}
} else if let Some(error) = result.error.as_deref() {
eprintln!("{}: {}", result.repo_root, error);
}
}View on GitHub (pinned to a747e741ae)
Solutions
- Read the per-repo `error` string to fix the failing repository.
- Pass a continue-on-error flag/option so one failure doesn't abort the remaining repos (JSON output then lists all results).
- Run the batch on the single failing repo in verbose mode to diagnose.
Example fix
// before run_batch(&repos, &opts); // opts.continue_on_error = false // after opts.continue_on_error = true; // inspect results[i].error instead of aborting
Defensive patterns
Strategy: try-catch
Try / catch
match run_batch(&repos, &opts) {
Err(e) => {
// find which repo failed from the message, fix it, then re-run with
// continue_on_error = true to get a full JSON result report
eprintln!("batch aborted: {e}");
opts.continue_on_error = true;
run_batch(&repos, &opts)?;
}
Ok(_) => {}
} Prevention
- Enable continue_on_error for multi-repo batches so one failure doesn't abort.
- Parse JSON batch output and inspect each result's error field.
- Fix or exclude known-bad repos before batching.
- Run batches in CI with per-repo error reporting enabled.
When it happens
Trigger: Running a batch repo command (e.g. bootstrap/push/update) where one repo fails, opts.continue_on_error is false, and result.error is Some; in JSON mode the result is printed first, then the error is raised.
Common situations: A single broken repo (bad remote, dirty tree, missing branch) aborts an otherwise multi-repo batch; CI runs where one repo's failure halts the loop.
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/a40a6c9796b730b8.
Report an issue: GitHub.