mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-01-23 22:12:48 +02:00
use error.Is to handle wrapped errors
This commit is contained in:
parent
0fb859c321
commit
41dcd9b4d4
@ -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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user