{"record":{"id":"8aba3c346d391085","repo":"ramensoftware/windhawk","slug":"data","errorCode":null,"errorMessage":"{}: {}","messagePattern":"\\{\\}: \\{\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/windhawk-core/cli/src/commands/data.rs","lineNumber":49,"sourceCode":"/// `data export`: build the selection from the flags, call `exportUserData`,\n/// surface any per-mod warnings on stderr, and write the archive to the\n/// destination.\npub fn export(env: &Environment, args: DataExportArgs) -> Result<Box<dyn CommandResult>, CliError> {\n    let selection = build_selection(&SelectionFlags::from_export(&args))?;\n    validate_export_per_mod_scope(env, &selection)?;\n    let params = ExportUserDataParams {\n        selection,\n        options: ExportOptions {\n            offline: args.offline,\n        },\n    };\n    let result: ExportUserDataResult = env.core.invoke_as(\"exportUserData\", &params)?;\n\n    // Best-effort export: per-mod warnings go to stderr (they also ride in the\n    // `--json` summary), matching `data export` in the plan.\n    for warning in &result.summary.warnings {\n        env.logger\n            .warn(&format!(\"{}: {}\", warning.mod_id, warning.message));\n    }\n\n    let to_stdout = args.out == \"-\";\n    if !to_stdout {\n        write_archive(&args.out, &result.archive, args.force)?;\n    }\n\n    Ok(Box::new(ExportResult {\n        archive_to_stdout: to_stdout,\n        archive: result.archive,\n        out_path: (!to_stdout).then(|| args.out.clone()),\n        warnings: result.summary.warnings,\n    }))\n}\n\n/// `data inspect`: read the archive (file or stdin) and print its manifest.\n/// Session-free.\npub fn inspect(core: &GatedCore, path: &str) -> Result<Box<dyn CommandResult>, CliError> {","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-core/cli/src/commands/data.rs#L31-L67","documentation":"A warning message logged during `data export`, formatted as '<mod_id>: <message>'. The core's exportUserData reports per-mod problems (e.g. mods skipped because their version or source was unusable) in summary.warnings, and the CLI echoes each one to stderr so the user knows which mods were left out of the archive.","triggerScenarios":"Running `windhawk data export` when one or more installed mods cannot be fully exported — no recorded version, unreadable source, or a load failure — while the rest of the archive is still produced.","commonSituations":"Exporting an archive that includes a broken mod install; a mod whose source file was deleted or edited into an unreadable state; exporting in offline mode where repository sources can't be fetched.","solutions":["Read the warning text after the mod id to see why it was skipped","Fix the specific mod (reinstall it or restore its source file) and re-export","Drop the broken mod from the selection if it isn't needed in the archive","Treat the exit as success-with-warnings: the archive itself was still written"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let result: ExportUserDataResult = env.core.invoke_as(\"exportUserData\", &params)?;\nlet broken: Vec<_> = result.summary.warnings.iter().map(|w| &w.mod_id).collect();\nif !broken.is_empty() { eprintln!(\"mods not fully exported: {broken:?}\"); }","typeGuard":null,"tryCatchPattern":"match export(env, args) {\n    Ok(r) if r.summary.warnings.is_empty() => println!(\"clean export\"),\n    Ok(r) => for w in &r.summary.warnings { eprintln!(\"{}: {}\", w.mod_id, w.message) },\n    Err(e) => return Err(e),\n}","preventionTips":["Check summary.warnings before assuming the archive is complete","Reinstall mods that show warnings and re-export","Validate the archive by importing it into a test profile"],"tags":["cli","export","user-data"],"backgroundTag":"api-error-response","analyzedSha":"61d99ed8e182e1af1b60109612b6763ad1b4b74e","analyzedAt":"2026-09-12T14:02:41.115Z","contentChangedAt":"2026-09-12T14:02:41.115Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}