mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-29 00:10:24 +01:00
skip wrapping sql.ErrNoRows
This commit is contained in:
1 parent
cdfc1f7b70
commit
14a2fd6215
1 file changed
+5
-3
+5
-3
@@ -2,6 +2,8 @@ package daos
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -27,11 +29,11 @@ func execLockRetry(timeout time.Duration, maxRetries int) dbx.ExecHookFunc {
|
||||
execErr := baseLockRetry(func(attempt int) error {
|
||||
return op()
|
||||
}, maxRetries)
|
||||
if execErr != nil {
|
||||
return fmt.Errorf("%w; failed query: %s", execErr, q.SQL())
|
||||
if execErr != nil && !errors.Is(execErr, sql.ErrNoRows) {
|
||||
execErr = fmt.Errorf("%w; failed query: %s", execErr, q.SQL())
|
||||
}
|
||||
|
||||
return nil
|
||||
return execErr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user