@@ -108,18 +108,39 @@ async fn take_screenshot(_options: Option<ScreenshotOptions>) -> Result<String,
108108
109109#[ tauri:: command]  
110110async  fn  read_file ( path :  String ,  _options :  Option < FileOperationOptions > )  -> Result < String ,  String >  { 
111-     std:: fs:: read_to_string ( & path) . map_err ( |e| e. to_string ( ) ) 
111+     println ! ( "🔍 Rust: read_file called with path: '{}'" ,  path) ; 
112+     let  result = std:: fs:: read_to_string ( & path) . map_err ( |e| { 
113+         let  error_msg = format ! ( "Failed to read file '{}': {}" ,  path,  e) ; 
114+         println ! ( "🔍 Rust: read_file error: {}" ,  error_msg) ; 
115+         error_msg
116+     } ) ; 
117+     if  result. is_ok ( )  { 
118+         println ! ( "🔍 Rust: read_file succeeded for path: '{}', content length: {}" ,  path,  result. as_ref( ) . unwrap( ) . len( ) ) ; 
119+     } 
120+     result
112121} 
113122
114123#[ tauri:: command]  
115124async  fn  write_file ( path :  String ,  contents :  String ,  _options :  Option < FileOperationOptions > )  -> Result < ( ) ,  String >  { 
116-     std:: fs:: write ( & path,  contents) . map_err ( |e| e. to_string ( ) ) ?; 
125+     println ! ( "🔍 Rust: write_file called with path: '{}', contents length: {}" ,  path,  contents. len( ) ) ; 
126+     std:: fs:: write ( & path,  contents) . map_err ( |e| { 
127+         let  error_msg = format ! ( "Failed to write file '{}': {}" ,  path,  e) ; 
128+         println ! ( "🔍 Rust: write_file error: {}" ,  error_msg) ; 
129+         error_msg
130+     } ) ?; 
131+     println ! ( "🔍 Rust: write_file succeeded for path: '{}'" ,  path) ; 
117132    Ok ( ( ) ) 
118133} 
119134
120135#[ tauri:: command]  
121136async  fn  delete_file ( path :  String )  -> Result < ( ) ,  String >  { 
122-     std:: fs:: remove_file ( & path) . map_err ( |e| e. to_string ( ) ) ?; 
137+     println ! ( "🔍 Rust: delete_file called with path: '{}'" ,  path) ; 
138+     std:: fs:: remove_file ( & path) . map_err ( |e| { 
139+         let  error_msg = format ! ( "Failed to delete file '{}': {}" ,  path,  e) ; 
140+         println ! ( "🔍 Rust: delete_file error: {}" ,  error_msg) ; 
141+         error_msg
142+     } ) ?; 
143+     println ! ( "🔍 Rust: delete_file succeeded for path: '{}'" ,  path) ; 
123144    Ok ( ( ) ) 
124145} 
125146
0 commit comments