@@ -842,6 +842,8 @@ func (fs *localfs) Delete(ctx context.Context, ref *provider.Reference) error {
842
842
}
843
843
844
844
func (fs * localfs ) Move (ctx context.Context , oldRef , newRef * provider.Reference ) error {
845
+ log := appctx .GetLogger (ctx )
846
+ log .Debug ().Any ("from" , oldRef ).Any ("to" , newRef ).Msg ("localfs: move" )
845
847
oldName , err := fs .resolve (ctx , oldRef )
846
848
if err != nil {
847
849
return errors .Wrap (err , "localfs: error resolving ref" )
@@ -860,6 +862,7 @@ func (fs *localfs) Move(ctx context.Context, oldRef, newRef *provider.Reference)
860
862
newName = fs .wrap (ctx , newName )
861
863
862
864
if err := os .Rename (oldName , newName ); err != nil {
865
+ log .Error ().Err (err ).Msg ("localfs: error moving " + oldName + " to " + newName )
863
866
return errors .Wrap (err , "localfs: error moving " + oldName + " to " + newName )
864
867
}
865
868
@@ -1062,7 +1065,10 @@ func (fs *localfs) listShareFolderRoot(ctx context.Context, home string, mdKeys
1062
1065
1063
1066
func (fs * localfs ) Download (ctx context.Context , ref * provider.Reference ) (io.ReadCloser , error ) {
1064
1067
fn , err := fs .resolve (ctx , ref )
1068
+ log := appctx .GetLogger (ctx )
1069
+
1065
1070
if err != nil {
1071
+ log .Error ().Err (err ).Any ("ref" , ref ).Msg ("localfs: error resolving ref" )
1066
1072
return nil , errors .Wrap (err , "localfs: error resolving ref" )
1067
1073
}
1068
1074
@@ -1074,8 +1080,10 @@ func (fs *localfs) Download(ctx context.Context, ref *provider.Reference) (io.Re
1074
1080
r , err := os .Open (fn )
1075
1081
if err != nil {
1076
1082
if os .IsNotExist (err ) {
1083
+ log .Error ().Err (err ).Str ("path" , fn ).Msg ("localfs: file not found" )
1077
1084
return nil , errtypes .NotFound (fn )
1078
1085
}
1086
+ log .Error ().Err (err ).Str ("path" , fn ).Msg ("localfs: error opening file" )
1079
1087
return nil , errors .Wrap (err , "localfs: error reading " + fn )
1080
1088
}
1081
1089
return r , nil
0 commit comments