@@ -165,7 +165,10 @@ impl LocalSource {
165
165
166
166
for file in & filter_opts. glob_file {
167
167
for line in std:: fs:: read_to_string ( file)
168
- . map_err ( IgnoreErrorKind :: FromIoError ) ?
168
+ . map_err ( |err| IgnoreErrorKind :: ErrorGlob {
169
+ file : file. into ( ) ,
170
+ err,
171
+ } ) ?
169
172
. lines ( )
170
173
{
171
174
_ = override_builder
@@ -185,7 +188,10 @@ impl LocalSource {
185
188
186
189
for file in & filter_opts. iglob_file {
187
190
for line in std:: fs:: read_to_string ( file)
188
- . map_err ( IgnoreErrorKind :: FromIoError ) ?
191
+ . map_err ( |err| IgnoreErrorKind :: ErrorGlob {
192
+ file : file. into ( ) ,
193
+ err,
194
+ } ) ?
189
195
. lines ( )
190
196
{
191
197
_ = override_builder
@@ -254,7 +260,8 @@ impl ReadSourceOpen for OpenFile {
254
260
/// [`IgnoreErrorKind::UnableToOpenFile`]: crate::error::IgnoreErrorKind::UnableToOpenFile
255
261
fn open ( self ) -> RusticResult < Self :: Reader > {
256
262
let path = self . 0 ;
257
- File :: open ( path) . map_err ( |err| IgnoreErrorKind :: UnableToOpenFile ( err) . into ( ) )
263
+ File :: open ( & path)
264
+ . map_err ( |err| IgnoreErrorKind :: UnableToOpenFile { file : path, err } . into ( ) )
258
265
}
259
266
}
260
267
@@ -400,7 +407,11 @@ fn map_entry(
400
407
let node = if m. is_dir ( ) {
401
408
Node :: new_node ( name, NodeType :: Dir , meta)
402
409
} else if m. is_symlink ( ) {
403
- let target = read_link ( entry. path ( ) ) . map_err ( IgnoreErrorKind :: FromIoError ) ?;
410
+ let path = entry. path ( ) ;
411
+ let target = read_link ( path) . map_err ( |err| IgnoreErrorKind :: ErrorLink {
412
+ path : path. to_path_buf ( ) ,
413
+ err,
414
+ } ) ?;
404
415
let node_type = NodeType :: from_link ( & target) ;
405
416
Node :: new_node ( name, node_type, meta)
406
417
} else {
@@ -522,12 +533,18 @@ fn map_entry(
522
533
let extended_attributes = {
523
534
let path = entry. path ( ) ;
524
535
xattr:: list ( path)
525
- . map_err ( IgnoreErrorKind :: FromIoError ) ?
536
+ . map_err ( |err| IgnoreErrorKind :: ErrorXattr {
537
+ path : path. to_path_buf ( ) ,
538
+ err,
539
+ } ) ?
526
540
. map ( |name| {
527
541
Ok ( ExtendedAttribute {
528
542
name : name. to_string_lossy ( ) . to_string ( ) ,
529
543
value : xattr:: get ( path, name)
530
- . map_err ( IgnoreErrorKind :: FromIoError ) ?
544
+ . map_err ( |err| IgnoreErrorKind :: ErrorXattr {
545
+ path : path. to_path_buf ( ) ,
546
+ err,
547
+ } ) ?
531
548
. unwrap ( ) ,
532
549
} )
533
550
} )
@@ -554,7 +571,11 @@ fn map_entry(
554
571
let node = if m. is_dir ( ) {
555
572
Node :: new_node ( name, NodeType :: Dir , meta)
556
573
} else if m. is_symlink ( ) {
557
- let target = read_link ( entry. path ( ) ) . map_err ( IgnoreErrorKind :: FromIoError ) ?;
574
+ let path = entry. path ( ) ;
575
+ let target = read_link ( path) . map_err ( |err| IgnoreErrorKind :: ErrorLink {
576
+ path : path. to_path_buf ( ) ,
577
+ err,
578
+ } ) ?;
558
579
let node_type = NodeType :: from_link ( & target) ;
559
580
Node :: new_node ( name, node_type, meta)
560
581
} else if filetype. is_block_device ( ) {
0 commit comments