From b56ad4e465eb87045eb17a2012d545f7e9be7510 Mon Sep 17 00:00:00 2001 From: fnrir Date: Tue, 27 Jun 2023 10:51:35 +0200 Subject: [PATCH] Increase read_file verbosity Changed the error message that gets printed when Culti tries to read a file, but fails. --- src-tauri/src/file_helpers.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src-tauri/src/file_helpers.rs b/src-tauri/src/file_helpers.rs index 042db97..3caf0c8 100644 --- a/src-tauri/src/file_helpers.rs +++ b/src-tauri/src/file_helpers.rs @@ -131,11 +131,10 @@ pub fn read_file(path: String) -> String { let mut file = match fs::File::open(path_buf) { Ok(file) => file, Err(e) => { + println!("Failed to open file {}: {}", &path, e); if path.contains("config") { // Server.ts won't print the error so handle the message here for the user println!("Server config not found or invalid. Be sure to run the server at least once to generate it before making edits."); - } else { - println!("Failed to open file: {}", e); } return String::new(); // Send back error for handling by the caller }