Skip to content

Commit

Permalink
Record actual statement text in error message (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamachor authored Oct 10, 2024
1 parent 33a24a2 commit 9d5e135
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@ protected final QueryResult executeStatement(
throws ClientException {
boolean execute = true;
QueryResult queryResult = null;
String statementText = StringUtils.replaceParameters(statement, values).getStatement();
Instant statementStartTime = Instant.now();

while (execute) {
try {
if (ignoreResults) {
connection.execute(StringUtils.replaceParameters(statement, values).getStatement());
connection.execute(statementText);
} else {
queryResult =
connection.executeQuery(
StringUtils.replaceParameters(statement, values).getStatement());
queryResult = connection.executeQuery(statementText);
}
execute = false;
writeStatementEvent(
Expand All @@ -109,7 +108,7 @@ protected final QueryResult executeStatement(
"Exception executing statement: "
+ statement.getId()
+ ", statement text: "
+ statement.getStatement()
+ statementText
+ "; error message: "
+ e.getMessage();

Expand Down

0 comments on commit 9d5e135

Please sign in to comment.