Skip to content

Commit

Permalink
Fix error handling in LoadIndexes
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacher committed Oct 11, 2022
1 parent 8471f4f commit 2b4c15c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion updater/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"io/fs"
"net/http"
"os"
"path/filepath"
Expand Down Expand Up @@ -102,7 +103,7 @@ func (reg *ResourceRegistry) LoadIndexes(ctx context.Context) error {
} else if reg.Online {
// try to download the index file if a local disk version
// does not exist or we don't have permission to read it.
if os.IsNotExist(err) || os.IsPermission(err) {
if errors.Is(err, fs.ErrNotExist) || errors.Is(err, fs.ErrPermission) {
err = reg.downloadIndex(ctx, client, idx)
}
}
Expand Down

0 comments on commit 2b4c15c

Please sign in to comment.