{"record":{"id":"38dc10ad18b90888","repo":"glzr-io/glazewm","slug":"not-a-valid-tiling-direction","errorCode":null,"errorMessage":"Not a valid tiling direction: {}","messagePattern":"Not a valid tiling direction: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/wm-common/src/tiling_direction.rs","lineNumber":69,"sourceCode":"  type Err = anyhow::Error;\r\n\r\n  /// Parses a string into a tiling direction.\r\n  ///\r\n  /// Example:\r\n  /// ```\r\n  /// # use wm_common::TilingDirection;\r\n  /// # use std::str::FromStr;\r\n  /// let dir = TilingDirection::from_str(\"horizontal\");\r\n  /// assert_eq!(dir.unwrap(), TilingDirection::Horizontal);\r\n  ///\r\n  /// let dir = TilingDirection::from_str(\"vertical\");\r\n  /// assert_eq!(dir.unwrap(), TilingDirection::Vertical);\r\n  /// ```\r\n  fn from_str(unparsed: &str) -> anyhow::Result<Self> {\r\n    match unparsed {\r\n      \"horizontal\" => Ok(Self::Horizontal),\r\n      \"vertical\" => Ok(Self::Vertical),\r\n      _ => bail!(\"Not a valid tiling direction: {}\", unparsed),\r\n    }\r\n  }\r\n}\r\n","sourceCodeStart":51,"sourceCodeEnd":73,"githubUrl":"https://github.com/glzr-io/glazewm/blob/5709ad0a3c7c386bbc3e38166a865ffc12937515/packages/wm-common/src/tiling_direction.rs#L51-L73","documentation":"`TilingDirection::from_str` parses a user-supplied string into the `TilingDirection` enum. It only accepts the exact literals \"horizontal\" and \"vertical\"; any other string makes it bail with this message including the offending input.","triggerScenarios":"Calling `\"left\".parse::<TilingDirection>()`, `TilingDirection::from_str(\"Horizontal\")` (case mismatch), or binding a WM config/IPC value like \"horiz\" or \"h\" to a tiling direction.","commonSituations":"Typos in GlazeWM config files or IPC commands (e.g. `tiling_direction: horizontal ` with trailing whitespace, capitalized text, or translated values in keybinding definitions).","solutions":["Use exactly \"horizontal\" or \"vertical\", all lowercase, no surrounding whitespace","Call `.trim().to_lowercase()` on the input before parsing","Match on the valid variants via `TilingDirection::iter()` or check the enum definition in packages/wm-common/src/tiling_direction.rs"],"exampleFix":"// before\nlet dir = \"Horizontal\".parse::<TilingDirection>()?;\n// after\nlet dir = \"horizontal\".parse::<TilingDirection>()?;","handlingStrategy":"validation","validationCode":"fn is_valid_tiling_direction(s: &str) -> bool {\n  matches!(s.trim().to_lowercase().as_str(), \"horizontal\" | \"vertical\")\n}","typeGuard":"fn as_tiling_direction(s: &str) -> Option<TilingDirection> {\n  match s.trim().to_lowercase().as_str() {\n    \"horizontal\" => Some(TilingDirection::Horizontal),\n    \"vertical\" => Some(TilingDirection::Vertical),\n    _ => None,\n  }\n}","tryCatchPattern":"match \"Horizontal\".parse::<TilingDirection>() {\n  Ok(dir) => use_dir(dir),\n  Err(e) => eprintln!(\"invalid tiling direction: {e}\"),\n}","preventionTips":["Normalize user input with trim().to_lowercase() before parsing","Keep direction strings centralized in config constants","Validate config values at load time with clear diagnostics"],"tags":["parsing","enum","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"5709ad0a3c7c386bbc3e38166a865ffc12937515","analyzedAt":"2026-09-08T03:26:40.288Z","contentChangedAt":"2026-09-08T03:26:40.288Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}