Skip to content

Commit

Permalink
wrap errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Erin Pentecost committed Jul 15, 2021
1 parent 5791025 commit 7f65b34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions localfs/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ func (l *LocalStore) Get(ctx context.Context, o string) (cloudstorage.Object, er
func (l *LocalStore) Delete(ctx context.Context, obj string) error {
fo := path.Join(l.storepath, obj)
if err := os.Remove(fo); err != nil {
return err
return fmt.Errorf("removing dir=%s: %w", fo, err)
}
mf := fo + ".metadata"
if cloudstorage.Exists(mf) {
if err := os.Remove(mf); err != nil {
return err
return fmt.Errorf("removing dir=%s: %w", mf, err)
}
}

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

0 comments on commit 7f65b34

Please sign in to comment.