{"record":{"id":"1df34e8ae9be3894","repo":"Hmbown/CodeWhale","slug":"invalid-cron-field-name-value-raw","errorCode":null,"errorMessage":"Invalid CRON {field_name} value '{raw}'","messagePattern":"Invalid CRON (.+?) value '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/automation_manager.rs","lineNumber":958,"sourceCode":"    fn lookup(self, token: &str) -> Option<u32> {\n        let needle = token.trim().to_ascii_uppercase();\n        self.0\n            .iter()\n            .find_map(|(name, value)| (*name == needle).then_some(*value))\n    }\n}\n\nfn parse_cron_atom(\n    raw: &str,\n    min: u32,\n    max: u32,\n    names: CronNameMap,\n    field_name: &str,\n) -> Result<u32> {\n    let value = names\n        .lookup(raw)\n        .or_else(|| raw.parse::<u32>().ok())\n        .ok_or_else(|| anyhow::anyhow!(\"Invalid CRON {field_name} value '{raw}'\"))?;\n    if !(min..=max).contains(&value) {\n        bail!(\"CRON {field_name} value {value} is out of range {min}-{max}\");\n    }\n    Ok(value)\n}\n\nfn weekday_to_cron(day: Weekday) -> u32 {\n    match day {\n        Weekday::Sun => 0,\n        Weekday::Mon => 1,\n        Weekday::Tue => 2,\n        Weekday::Wed => 3,\n        Weekday::Thu => 4,\n        Weekday::Fri => 5,\n        Weekday::Sat => 6,\n    }\n}\n","sourceCodeStart":940,"sourceCodeEnd":976,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/automation_manager.rs#L940-L976","documentation":"Cron field guard in parse_cron_atom: the token for the named field is neither a recognized name (e.g. JAN/MON) nor a parseable unsigned integer. It fires on malformed atoms like 'X' or '9x' before the min..=max range check runs (out-of-range numeric values produce the other error).","triggerScenarios":"Thrown at crates/tui/src/automation_manager.rs:958 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a plain number or the field's accepted names (months weekdays) in the CRON field.","Remove stray characters/whitespace from the atom."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}