diff --git a/core/base.go b/core/base.go index e80baff4..4d0c0a34 100644 --- a/core/base.go +++ b/core/base.go @@ -565,7 +565,7 @@ func (app *BaseApp) RefreshSettings() error { encryptionKey := os.Getenv(app.EncryptionEnv()) storedSettings, err := app.Dao().FindSettings(encryptionKey) - if err != nil && err != sql.ErrNoRows { + if err != nil && !errors.Is(err, sql.ErrNoRows) { return err } diff --git a/core/base_settings_test.go b/core/base_settings_test.go index 08c51584..4c38a829 100644 --- a/core/base_settings_test.go +++ b/core/base_settings_test.go @@ -20,7 +20,7 @@ func TestBaseAppRefreshSettings(t *testing.T) { // check if the new settings are saved in the db app.ResetEventCalls() if err := app.RefreshSettings(); err != nil { - t.Fatal("Failed to refresh the settings after delete") + t.Fatalf("Failed to refresh the settings after delete: %v", err) } testEventCalls(t, app, map[string]int{ "OnModelBeforeCreate": 1,