mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-28 16:00:24 +01:00
added the failed dao query to the error message
This commit is contained in:
1 parent
4d27278c60
commit
58a2d3cd09
1 file changed
+7
-1
+7
-1
@@ -2,6 +2,7 @@ package daos
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -23,9 +24,14 @@ func execLockRetry(timeout time.Duration, maxRetries int) dbx.ExecHookFunc {
|
||||
q.WithContext(cancelCtx)
|
||||
}
|
||||
|
||||
return baseLockRetry(func(attempt int) error {
|
||||
execErr := baseLockRetry(func(attempt int) error {
|
||||
return op()
|
||||
}, maxRetries)
|
||||
if execErr != nil {
|
||||
return fmt.Errorf("%w; failed query: %s", execErr, q.SQL())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user