fix: error handling in various handlers and services

- Updated error variable names for clarity in DNS provider, import, logs, manual challenge, security, user, and other handlers.
- Improved error handling in services such as backup, credential, docker, mail, notification, security headers, and uptime services.
- Enhanced readability by using more descriptive variable names for errors in multiple locations across the codebase.
- Ensured consistent error handling practices throughout the application.
This commit is contained in:
GitHub Actions
2026-02-08 08:04:35 +00:00
parent d62cc35635
commit a574f48ba1
36 changed files with 230 additions and 230 deletions

View File

@@ -31,14 +31,14 @@ func TestResetPasswordCommand_Succeeds(t *testing.T) {
if err != nil {
t.Fatalf("connect db: %v", err)
}
if err := db.AutoMigrate(&models.User{}); err != nil {
if err = db.AutoMigrate(&models.User{}); err != nil {
t.Fatalf("automigrate: %v", err)
}
email := "user@example.com"
user := models.User{UUID: "u-1", Email: email, Name: "User", Role: "admin", Enabled: true}
user.PasswordHash = "$2a$10$example_hashed_password"
if err := db.Create(&user).Error; err != nil {
if err = db.Create(&user).Error; err != nil {
t.Fatalf("seed user: %v", err)
}
@@ -80,7 +80,7 @@ func TestMigrateCommand_Succeeds(t *testing.T) {
t.Fatalf("connect db: %v", err)
}
// Only migrate User table to simulate old database
if err := db.AutoMigrate(&models.User{}); err != nil {
if err = db.AutoMigrate(&models.User{}); err != nil {
t.Fatalf("automigrate user: %v", err)
}
@@ -138,7 +138,7 @@ func TestStartupVerification_MissingTables(t *testing.T) {
t.Fatalf("connect db: %v", err)
}
// Only migrate User table to simulate old database
if err := db.AutoMigrate(&models.User{}); err != nil {
if err = db.AutoMigrate(&models.User{}); err != nil {
t.Fatalf("automigrate user: %v", err)
}