{"record":{"id":"941171783dacda04","repo":"AprilNEA/OpenLogi","slug":"unknown-control-raw","errorCode":null,"errorMessage":"unknown control {raw:?} ({})","messagePattern":"unknown control (.+?) \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/camera.rs","lineNumber":100,"sourceCode":"                openlogi_camera::set_control(&uid, control, value).map_err(|e| anyhow!(\"{e}\"))?;\n                println!(\"set {} = {value}\", control.name());\n            }\n        }\n    }\n    Ok(())\n}\n\nfn parse_control(raw: &str) -> Result<CameraControl> {\n    CameraControl::ALL\n        .into_iter()\n        .find(|c| c.name() == raw)\n        .ok_or_else(|| {\n            let names: Vec<&str> = CameraControl::ALL\n                .iter()\n                .map(|c| c.name())\n                .chain(AutoToggle::ALL.iter().map(|t| t.name()))\n                .collect();\n            anyhow!(\"unknown control {raw:?} ({})\", names.join(\"|\"))\n        })\n}\n","sourceCodeStart":82,"sourceCodeEnd":103,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/camera.rs#L82-L103","documentation":"Thrown by `parse_control` in the camera CLI when the given control name (lowercased) matches neither any `CameraControl::ALL` name nor any `AutoToggle::ALL` name. The message echoes the raw input and lists every accepted name pipe-separated, so it doubles as inline help. It is a pure name-resolution failure — no hardware is touched.","triggerScenarios":"Running `openlogi camera set <name> <value>` where `<name>` is misspelled, uses the wrong case convention beyond the ASCII-lowercase normalization (e.g. contains spaces or hyphens instead of the canonical form), or names a control that does not exist in this build's catalog.","commonSituations":"Typo like `brighness` instead of `brightness`; guessing names from UVC terminology (e.g. `white_balance_temperature`) instead of the CLI's shorter catalog names; scripting against an older CLI version whose control catalog differed.","solutions":["Copy a control name exactly from the error's parenthesized list — it enumerates every valid name.","Check for typos and use the exact spelling shown (names are compared after ASCII-lowercasing).","If the control genuinely isn't listed, the CLI's catalog doesn't expose it; use a different control or extend `CameraControl::ALL` upstream."],"exampleFix":"// before: guessed name\n$ openlogi camera set exposure_time 120\n// error: unknown control \"exposure_time\" (brightness|contrast|...)\n// after: use a listed name\n$ openlogi camera set exposure 120","handlingStrategy":"validation","validationCode":"// resolve the name against the same catalogs the CLI uses before invoking set\nlet names: Vec<&str> = CameraControl::ALL.iter().map(|c| c.name())\n    .chain(AutoToggle::ALL.iter().map(|t| t.name())).collect();\nif !names.contains(&raw.as_str()) {\n    eprintln!(\"unknown control {raw:?}; valid: {}\", names.join(\"|\"));\n}","typeGuard":null,"tryCatchPattern":"// treat parse_control failure as usage error, not runtime failure\nlet control = match parse_control(&raw) {\n    Ok(c) => c,\n    Err(e) => { eprintln!(\"{e:#}\"); std::process::exit(2); } // exit code 2 = usage\n};","preventionTips":["Copy control names from the error's enumerated list or the list command output.","Keep a shell alias/completion for valid camera control names.","Run `openlogi camera set` with no args first to see usage and accepted names.","Pin the CLI version in scripts so the control catalog cannot shift underneath you."],"tags":["cli","camera","argument-parsing"],"backgroundTag":"invalid-enum-value","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}