diff --git a/src/client/panes/grid.rs b/src/client/panes/grid.rs index e893fd32..9d924220 100644 --- a/src/client/panes/grid.rs +++ b/src/client/panes/grid.rs @@ -1261,7 +1261,9 @@ impl vte::Perform for Grid { self.insert_character_at_cursor_position(EMPTY_TERMINAL_CHARACTER); } } else { - let _ = debug_log_to_file(format!("Unhandled csi: {}->{:?}", c, params)); + let result = debug_log_to_file(format!("Unhandled csi: {}->{:?}", c, params)); + #[cfg(not(test))] + result.unwrap(); } } diff --git a/src/common/utils/logging.rs b/src/common/utils/logging.rs index 4c53e2b2..0dd382d6 100644 --- a/src/common/utils/logging.rs +++ b/src/common/utils/logging.rs @@ -10,14 +10,12 @@ use std::{ use crate::os_input_output::set_permissions; use crate::utils::consts::{ZELLIJ_TMP_LOG_DIR, ZELLIJ_TMP_LOG_FILE}; -pub fn atomic_create_file(file_name: &Path) { +pub fn atomic_create_file(file_name: &Path) -> io::Result<()> { let _ = fs::OpenOptions::new() .append(true) .create(true) - .open(file_name) - .unwrap(); - #[cfg(not(test))] - set_permissions(file_name).unwrap(); + .open(file_name)?; + set_permissions(file_name) } pub fn atomic_create_dir(dir_name: &Path) -> io::Result<()> { @@ -42,7 +40,7 @@ pub fn debug_log_to_file(mut message: String) -> io::Result<()> { } pub fn debug_log_to_file_without_newline(message: String) -> io::Result<()> { - atomic_create_file(&*ZELLIJ_TMP_LOG_FILE); + atomic_create_file(&*ZELLIJ_TMP_LOG_FILE)?; let mut file = fs::OpenOptions::new() .append(true) .open(&*ZELLIJ_TMP_LOG_FILE)?;