{"record":{"id":"a8cc8256341520e9","repo":"ruvnet/RuView","slug":"serialize-e","errorCode":null,"errorMessage":"serialize: {e}","messagePattern":"serialize: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v2/crates/wifi-densepose-cli/src/room.rs","lineNumber":206,"sourceCode":"        if !accepted {\n            eprintln!(\"[enroll]   moving on without '{}'\", label.as_str());\n        }\n    }\n\n    if session.is_complete() {\n        session.apply(EnrollmentEvent::Completed { at: now_unix() });\n    }\n    let (got, total) = session.progress();\n    let data = EnrollmentData {\n        room_id: args.room_id.clone(),\n        baseline_id,\n        fs_hz: args.fs_hz,\n        anchors: features,\n        session,\n    };\n    std::fs::write(\n        &args.output,\n        serde_json::to_string_pretty(&data).map_err(|e| anyhow::anyhow!(\"serialize: {e}\"))?,\n    )\n    .map_err(|e| anyhow::anyhow!(\"cannot write {}: {e}\", args.output))?;\n    eprintln!(\n        \"\\n[enroll] done: {got}/{total} anchors accepted → {} (next: `train-room`)\",\n        args.output\n    );\n    Ok(())\n}\n\n// ---------------------------------------------------------------------------\n// train-room\n// ---------------------------------------------------------------------------\n\n/// Arguments for `train-room`.\n#[derive(Args, Debug, Clone)]\npub struct TrainRoomArgs {\n    /// Enrollment file from `enroll`.\n    #[arg(long, default_value = \"./enrollment.json\")]","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/v2/crates/wifi-densepose-cli/src/room.rs#L188-L224","documentation":"serde_json::to_string_pretty failed while serializing EnrollmentData (room_id, baseline_id, fs_hz, anchors, session) at the end of enroll. EnrollmentData is plain JSON-safe data (strings, f32, Vec, derived Serialize), so this is a defensive guard that in practice only triggers if a nested custom Serialize impl errors or the schema is changed to something JSON-unsafe.","triggerScenarios":"Effectively unreachable with the current structs; would require a modified AnchorFeature/EnrollmentSession Serialize impl returning an error (e.g. non-string map keys or a manually failing serializer introduced later).","commonSituations":"Almost never seen in the field; appears mainly in error catalogues as a low-probability guard around an infallible call.","solutions":["Treat it as a bug: identify which field's Serialize impl failed from the {e} payload","If you modified the enrollment structs, add a unit test asserting to_string_pretty succeeds on sample data","Re-run the enrollment — the features were in-memory only and are lost if the process exits"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let json = serde_json::to_string_pretty(&data)\n    .map_err(|e| anyhow::anyhow!(\"serialize: {e}\"))?;\n// Not pre-validatable: treat any failure as a schema bug and unit-test\n// EnrollmentData serialization whenever its structs change.","preventionTips":["Unit-test serialization of EnrollmentData whenever its schema changes","Keep enroll structs JSON-safe (String keys, finite floats, derived Serialize)"],"tags":["rust","serde","json","serialization"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}