Skip to content

Commit

Permalink
better error for normalize failure in postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed May 16, 2024
1 parent 1d45f6a commit c072c8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,14 @@ func (c *PostgresConnector) NormalizeRecords(
for _, normalizeStatement := range normalizeStatements {
ct, err := normalizeRecordsTx.Exec(ctx, normalizeStatement, normBatchID, req.SyncBatchID, destinationTableName)
if err != nil {
return nil, fmt.Errorf("error executing normalize statement: %w", err)
c.logger.Error("error executing normalize statement",
slog.String("statement", normalizeStatement),
slog.Int64("normBatchID", normBatchID),
slog.Int64("syncBatchID", req.SyncBatchID),
slog.String("destinationTableName", destinationTableName),
slog.Any("error", err),
)
return nil, fmt.Errorf("error executing normalize statement for table %s: %w", destinationTableName, err)
}
totalRowsAffected += int(ct.RowsAffected())
}
Expand Down

0 comments on commit c072c8b

Please sign in to comment.