1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2024-11-24 17:07:00 +02:00

added the failed dao query to the error message

This commit is contained in:
Gani Georgiev 2023-12-03 20:54:48 +02:00
parent 4d27278c60
commit 58a2d3cd09

View File

@ -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
}
}