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…
	
		Reference in New Issue