Skip to content

Commit 7f65b34

Browse files
author
Erin Pentecost
committed
wrap errors
1 parent 5791025 commit 7f65b34

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

localfs/store.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ func (l *LocalStore) Get(ctx context.Context, o string) (cloudstorage.Object, er
280280
func (l *LocalStore) Delete(ctx context.Context, obj string) error {
281281
fo := path.Join(l.storepath, obj)
282282
if err := os.Remove(fo); err != nil {
283-
return err
283+
return fmt.Errorf("removing dir=%s: %w", fo, err)
284284
}
285285
mf := fo + ".metadata"
286286
if cloudstorage.Exists(mf) {
287287
if err := os.Remove(mf); err != nil {
288-
return err
288+
return fmt.Errorf("removing dir=%s: %w", mf, err)
289289
}
290290
}
291291

@@ -299,7 +299,7 @@ func (l *LocalStore) Delete(ctx context.Context, obj string) error {
299299
dir.Close()
300300
// it's empty, so remove it.
301301
if err := os.Remove(l.storepath); err != nil {
302-
return err
302+
return fmt.Errorf("failed to remove store dir=%s err=%w", l.storepath, err)
303303
}
304304
} else {
305305
dir.Close()

0 commit comments

Comments
 (0)