Skip to content

Commit 7916790

Browse files
authored
better error handling for getPartitions (#3742)
make sure `getPartitions` error gets surfaced right away to make log less confusing.
1 parent 92cc1a0 commit 7916790

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

flow/connectors/postgres/qrep.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ func (c *PostgresConnector) GetQRepPartitions(
7373
}
7474

7575
partitions, err := c.getPartitions(ctx, getPartitionsTx, config, last)
76+
if err != nil {
77+
return nil, fmt.Errorf("failed to get partitions: %w", err)
78+
}
7679

7780
// commit transaction
7881
if err := getPartitionsTx.Commit(ctx); err != nil {
7982
return nil, fmt.Errorf("failed to commit transaction: %w", err)
8083
}
8184

82-
return partitions, err
85+
return partitions, nil
8386
}
8487

8588
func (c *PostgresConnector) GetDefaultPartitionKeyForTables(

0 commit comments

Comments
 (0)