tony / oxwm

src/window_manager: return error instead of panic in `try_reload_config` when lua_path is not found Browse files
emzywastaken committed 2025-12-15 parent a96e35b commit d2f3ce90ccff47c6bc223c62873b46e6b4bf24c7
Showing 1 changed file with 4 additions and 5 deletions. UnifiedSplit
+4 −5 src/window_manager.rs
@@ -346,11 +346,10 @@ impl WindowManager {
346 346 }
347 347
348 348 fn try_reload_config(&mut self) -> Result<(), String> {
349 - let lua_path = self
350 - .config
351 - .path
352 - .take()
353 - .expect("Could not find config file. Config path should've been set while loading");
349 + let lua_path =
350 + self.config.path.take().ok_or(
351 + "Could not find config file. Config path should've been set while loading",
352 + )?;
354 353
355 354 if !lua_path.exists() {
356 355 return Err("Could not find config file, has it been moved?".to_string());