mirror of
https://github.com/safing/portmaster
synced 2025-09-02 18:49:14 +00:00
Fix profile migration iteration error handling and only warn, not fail
This commit is contained in:
parent
b9127d3f91
commit
028986ed74
1 changed files with 4 additions and 4 deletions
|
@ -2,7 +2,6 @@ package profile
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/hashicorp/go-version"
|
"github.com/hashicorp/go-version"
|
||||||
|
|
||||||
|
@ -62,7 +61,8 @@ func migrateLinkedPath(ctx context.Context, _, to *version.Version, db *database
|
||||||
// Get iterator over all profiles.
|
// Get iterator over all profiles.
|
||||||
it, err := db.Query(query.New(profilesDBPath))
|
it, err := db.Query(query.New(profilesDBPath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to query profiles: %w", err)
|
log.Tracer(ctx).Errorf("profile: failed to migrate from linked path: failed to start query: %s", err)
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate all profiles.
|
// Migrate all profiles.
|
||||||
|
@ -91,8 +91,8 @@ func migrateLinkedPath(ctx context.Context, _, to *version.Version, db *database
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if there was an error while iterating.
|
// Check if there was an error while iterating.
|
||||||
if it.Err() != nil {
|
if err := it.Err(); err != nil {
|
||||||
return fmt.Errorf("profiles: failed to iterate over profiles for migration: %w", err)
|
log.Tracer(ctx).Errorf("profile: failed to migrate from linked path: failed to iterate over profiles for migration: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Reference in a new issue