mirror of
https://github.com/safing/portbase
synced 2025-09-01 10:09:50 +00:00
Fix error handling in LoadIndexes
This commit is contained in:
parent
8471f4f38a
commit
2b4c15c1f7
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue