mirror of
https://github.com/safing/portmaster
synced 2025-09-01 18:19:12 +00:00
Add module errors for failed profile migrations
This commit is contained in:
parent
a50b17d37d
commit
846c3420e7
1 changed files with 12 additions and 0 deletions
|
@ -162,6 +162,13 @@ func migrateIcons(ctx context.Context, _, to *version.Version, db *database.Inte
|
|||
|
||||
// Log migration failure and try again next time.
|
||||
if lastErr != nil {
|
||||
// Normally, an icon migration would not be such a big error, but this is a test
|
||||
// run for the profile IDs and we absolutely need to know if anything went wrong.
|
||||
module.Error(
|
||||
"migration-failed",
|
||||
"Profile Migration Failed",
|
||||
fmt.Sprintf("Failed to migrate icons of %d profiles (out of %d pending). The last error was: %s\n\nPlease restart Portmaster to try the migration again.", failed, total, lastErr),
|
||||
)
|
||||
return fmt.Errorf("failed to migrate %d profiles (out of %d pending) - last error: %w", failed, total, lastErr)
|
||||
}
|
||||
|
||||
|
@ -243,6 +250,11 @@ func migrateToDerivedIDs(ctx context.Context, _, to *version.Version, db *databa
|
|||
|
||||
// Log migration failure and try again next time.
|
||||
if lastErr != nil {
|
||||
module.Error(
|
||||
"migration-failed",
|
||||
"Profile Migration Failed",
|
||||
fmt.Sprintf("Failed to migrate profile IDs of %d profiles (out of %d pending). The last error was: %s\n\nPlease restart Portmaster to try the migration again.", failed, total, lastErr),
|
||||
)
|
||||
return fmt.Errorf("failed to migrate %d profiles (out of %d pending) - last error: %w", failed, total, lastErr)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue