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