@@ -184,15 +184,39 @@ impl HdfsStore {
184184 let parent_path_str = format ! ( "{}/" , parent_dir. to_str( ) . unwrap( ) ) ;
185185 debug ! ( "creating dir: {}" , parent_path_str. as_str( ) ) ;
186186
187- & filesystem. create_dir ( parent_path_str. as_str ( ) ) . await ?;
187+ & filesystem
188+ . create_dir ( parent_path_str. as_str ( ) )
189+ . await
190+ . map_err ( |e| {
191+ error ! ( "Errors on creating dir of {}" , parent_path_str. as_str( ) ) ;
192+ e
193+ } ) ?;
188194
189195 let data_file_complete_path = format ! ( "{}_{}.data" , & data_file_path_prefix, 0 ) ;
190196 let index_file_complete_path =
191197 format ! ( "{}_{}.index" , & index_file_path_prefix, 0 ) ;
192198
193199 // setup the file
194- & filesystem. touch ( & data_file_complete_path) . await ?;
195- & filesystem. touch ( & index_file_complete_path) . await ?;
200+ & filesystem
201+ . touch ( & data_file_complete_path)
202+ . await
203+ . map_err ( |e| {
204+ error ! (
205+ "Errors on touching file of {}" ,
206+ data_file_complete_path. as_str( )
207+ ) ;
208+ e
209+ } ) ?;
210+ & filesystem
211+ . touch ( & index_file_complete_path)
212+ . await
213+ . map_err ( |e| {
214+ error ! (
215+ "Errors on touching file of {}" ,
216+ index_file_complete_path. as_str( )
217+ ) ;
218+ e
219+ } ) ?;
196220
197221 self . partition_cached_meta
198222 . insert ( data_file_path_prefix. to_owned ( ) , Default :: default ( ) ) ;
@@ -290,7 +314,11 @@ impl HdfsStore {
290314 "hdfs writing [data] with {} bytes. path: {}" ,
291315 data_len, & data_file_path
292316 ) )
293- . await ?;
317+ . await
318+ . map_err ( |e| {
319+ error ! ( "Errors on appending data into path: {}" , & data_file_path) ;
320+ e
321+ } ) ?;
294322 let index_bytes = index_bytes_holder. freeze ( ) ;
295323 let index_len = index_bytes. len ( ) ;
296324 filesystem
@@ -299,7 +327,11 @@ impl HdfsStore {
299327 "hdfs writing [index] with {} bytes. path: {}" ,
300328 index_len, & index_file_path
301329 ) )
302- . await ?;
330+ . await
331+ . map_err ( |e| {
332+ error ! ( "Errors on appending index into path: {}" , & index_file_path) ;
333+ e
334+ } ) ?;
303335 Ok ( ( ) )
304336 }
305337}
0 commit comments