fix: Improve errors in batch modes
This commit is contained in:
committed by
Jack Christensen
parent
1ce3e0384a
commit
11fa083a0d
@@ -1106,6 +1106,8 @@ func (c *Conn) sendBatchExtendedWithDescription(ctx context.Context, b *Batch, d
|
|||||||
for _, bi := range b.queuedQueries {
|
for _, bi := range b.queuedQueries {
|
||||||
err := c.eqb.Build(c.typeMap, bi.sd, bi.arguments)
|
err := c.eqb.Build(c.typeMap, bi.sd, bi.arguments)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// we wrap the error so we the user can understand which query failed inside the batch
|
||||||
|
err = fmt.Errorf("error building query %s: %w", bi.query, err)
|
||||||
return &pipelineBatchResults{ctx: ctx, conn: c, err: err}
|
return &pipelineBatchResults{ctx: ctx, conn: c, err: err}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user