{"record":{"id":"5b10ff9f4bbc4da7","repo":"flxzt/rnote","slug":"skipped","errorCode":null,"errorMessage":"Skipped {}","messagePattern":"Skipped (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/rnote-cli/src/export.rs","lineNumber":508,"sourceCode":"            on_conflict = OnConflict::Overwrite;\n            *on_conflict_overwrite = Some(on_conflict);\n        }\n        OnConflict::AlwaysSkip => {\n            on_conflict = OnConflict::Skip;\n            *on_conflict_overwrite = Some(on_conflict);\n        }\n        OnConflict::AlwaysSuffix => {\n            on_conflict = OnConflict::Suffix;\n            *on_conflict_overwrite = Some(on_conflict);\n        }\n        OnConflict::Overwrite | OnConflict::Skip | OnConflict::Suffix => (),\n    }\n    match on_conflict {\n        OnConflict::Ask => Err(anyhow::anyhow!(\n            \"on-conflict behaviour is still Ask after prompting the user.\"\n        )),\n        OnConflict::Overwrite => Ok(None),\n        OnConflict::Skip => Err(anyhow::anyhow!(\"Skipped {}\", output_file.display())),\n        OnConflict::Suffix => {\n            let mut i = 0;\n            let mut new_path = output_file.to_path_buf();\n            let Some(file_stem) = new_path\n                .file_stem()\n                .map(|s| s.to_string_lossy().to_string())\n            else {\n                return Err(anyhow::anyhow!(\"Failed to get file stem\"));\n            };\n            let ext = new_path\n                .extension()\n                .map(|n| n.to_string_lossy().to_string())\n                .unwrap_or_default();\n            while new_path.exists() {\n                i += 1;\n                new_path.set_file_name(format!(\"{file_stem}_{i}.{ext}\"))\n            }\n            Ok(Some(new_path))","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-cli/src/export.rs#L490-L526","documentation":"When the resolved on-conflict policy is `Skip`, `file_conflict_prompt_action` (crates/rnote-cli/src/export.rs:508) returns `Err(anyhow::anyhow!(\"Skipped {}\", output_file.display()))`. This is not a fault: skip is implemented as an error so callers using `?` naturally abort the export of this file, with the path embedded in the message. The string \"Skipped <path>\" is informational control flow.","triggerScenarios":"Calling `get_output_file_path` / `doc_page_determine_output_file` / `export_to_file` for an output path that already exists when `--on-conflict skip` (or `always-skip`, which downgrades to `Skip`) is selected, or the user picks \"Skip\" in the interactive conflict prompt.","commonSituations":"Batch-exporting many .rnote files where some outputs already exist from a previous run with `--on-conflict skip`/`--on-conflict always-skip`; scripting where downstream `?`/error handling surfaces these as failures; CI logs showing red \"errors\" for intentional skips.","solutions":["Inspect the error message: if it starts with `Skipped `, treat the operation as successful and continue with the next file.","Use `--on-conflict suffix` or `--on-conflict overwrite` instead if the existing file should not cause an aborted/blocked result.","In scripts, filter these messages out of the error stream, e.g. only fail on messages that do not begin with \"Skipped \".","Library fix: return a typed sentinel (e.g. an enum `ConflictOutcome::Skipped`) instead of encoding skip as an `Err`."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"fn is_skip_notice(err: &anyhow::Error) -> bool {\n    err.to_string().starts_with(\"Skipped \")\n}","tryCatchPattern":"match export_to_file(...).await {\n    Ok(()) => {/* exported */}\n    Err(e) if e.to_string().starts_with(\"Skipped \") => {\n        eprintln!(\"{e}\"); // intentional skip, not a failure\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Treat messages starting with 'Skipped ' as success in scripts and CI.","Prefer --on-conflict suffix or overwrite when you want a clean exit code instead of a skip notice.","Track skips in your own counter so batch runs report 'N skipped' rather than 'N errors'."],"tags":["cli","control-flow","file-conflict","skip"],"backgroundTag":"file-already-exists","analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}