{"record":{"id":"a40a6c9796b730b8","repo":"nikivdev/code","slug":"error-a40a6c","errorCode":null,"errorMessage":"{}","messagePattern":"\\{\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/repos.rs","lineNumber":767,"sourceCode":"                repo_root: entry.path.display().to_string(),\n                ok: true,\n                error: None,\n                bootstrap: Some(bootstrap),\n            },\n            Err(err) => HomeBranchMigrationResult {\n                repo_root: entry.path.display().to_string(),\n                ok: false,\n                error: Some(err.to_string()),\n                bootstrap: None,\n            },\n        };\n\n        if !result.ok && !opts.continue_on_error {\n            if opts.json {\n                println!(\"{}\", serde_json::to_string_pretty(&result)?);\n            }\n            if let Some(error) = result.error {\n                bail!(\"{}\", error);\n            }\n        }\n\n        results.push(result);\n    }\n\n    if opts.json {\n        println!(\"{}\", serde_json::to_string_pretty(&results)?);\n    } else {\n        for result in &results {\n            if result.ok {\n                if let Some(bootstrap) = result.bootstrap.as_ref() {\n                    print_home_branch_bootstrap_result(bootstrap);\n                }\n            } else if let Some(error) = result.error.as_deref() {\n                eprintln!(\"{}: {}\", result.repo_root, error);\n            }\n        }","sourceCodeStart":749,"sourceCodeEnd":785,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/repos.rs#L749-L785","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nrun_batch(&repos, &opts); // opts.continue_on_error = false\n// after\nopts.continue_on_error = true; // inspect results[i].error instead of aborting","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"match run_batch(&repos, &opts) {\n    Err(e) => {\n        // find which repo failed from the message, fix it, then re-run with\n        // continue_on_error = true to get a full JSON result report\n        eprintln!(\"batch aborted: {e}\");\n        opts.continue_on_error = true;\n        run_batch(&repos, &opts)?;\n    }\n    Ok(_) => {}\n}","preventionTips":["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."],"tags":["batch","propagated-error"],"backgroundTag":"operation-abort-on-error","analyzedSha":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}