Skip to content

Commit a27666c

Browse files
authored
Fix CoreError message parameter mismatches (#3164)
1 parent a117037 commit a27666c

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

core/src/main/java/com/scalar/db/common/CoreError.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ public enum CoreError implements ScalarDbError {
434434
CONSENSUS_COMMIT_CONDITION_NOT_ALLOWED_TO_TARGET_TRANSACTION_METADATA_COLUMNS(
435435
Category.USER_ERROR,
436436
"0100",
437-
"The condition is not allowed to target transaction metadata columns. Column: %s",
437+
"The condition is not allowed to target transaction metadata columns. Table: %s; Column: %s",
438438
"",
439439
""),
440440
CONSENSUS_COMMIT_COLUMN_RESERVED_AS_TRANSACTION_METADATA(
@@ -898,7 +898,7 @@ public enum CoreError implements ScalarDbError {
898898
OBJECT_STORAGE_PRIMARY_KEY_CONTAINS_ILLEGAL_CHARACTER(
899899
Category.USER_ERROR,
900900
"0257",
901-
"The value of the column %s in the primary key contains an illegal character.",
901+
"The value of the column %s in the primary key contains an illegal character. Value: %s",
902902
"",
903903
""),
904904
CONSENSUS_COMMIT_SPECIFYING_TRANSACTION_METADATA_COLUMNS_IN_PROJECTION_NOT_ALLOWED(
@@ -1244,7 +1244,11 @@ public enum CoreError implements ScalarDbError {
12441244
"",
12451245
""),
12461246
JDBC_MYSQL_GETTING_CONNECTION_METADATA_FAILED(
1247-
Category.INTERNAL_ERROR, "0063", "Getting the MySQL JDBC connection metadata failed", "", ""),
1247+
Category.INTERNAL_ERROR,
1248+
"0063",
1249+
"Getting the MySQL JDBC connection metadata failed. Details: %s",
1250+
"",
1251+
""),
12481252
OBJECT_STORAGE_ERROR_OCCURRED_IN_SELECTION(
12491253
Category.INTERNAL_ERROR, "0064", "An error occurred in the selection. Details: %s", "", ""),
12501254
OBJECT_STORAGE_ERROR_OCCURRED_IN_MUTATION(

core/src/main/java/com/scalar/db/storage/dynamo/BatchHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ public void handle(List<? extends Mutation> mutations) throws ExecutionException
9696
// If all the reasons of the cancellation are "TransactionConflict", throw
9797
// RetriableExecutionException
9898
throw new RetriableExecutionException(
99-
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(
100-
e.getMessage(), e),
99+
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(e.getMessage()),
101100
e);
102101
}
103102

core/src/main/java/com/scalar/db/storage/dynamo/DeleteStatementHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public void handle(Delete delete) throws ExecutionException {
5555
CoreError.NO_MUTATION_APPLIED.buildMessage(), Collections.singletonList(delete), e);
5656
} catch (TransactionConflictException e) {
5757
throw new RetriableExecutionException(
58-
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(
59-
e.getMessage(), e),
58+
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(e.getMessage()),
6059
e);
6160
} catch (DynamoDbException e) {
6261
throw new ExecutionException(

core/src/main/java/com/scalar/db/storage/dynamo/PutStatementHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ public void handle(Put put) throws ExecutionException {
5656
CoreError.NO_MUTATION_APPLIED.buildMessage(), Collections.singletonList(put), e);
5757
} catch (TransactionConflictException e) {
5858
throw new RetriableExecutionException(
59-
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(
60-
e.getMessage(), e),
59+
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(e.getMessage()),
6160
e);
6261
} catch (DynamoDbException e) {
6362
throw new ExecutionException(

core/src/main/java/com/scalar/db/storage/jdbc/RdbEngineFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ private static RdbEngineStrategy createMysqlOrTidbEngine(JdbcConfig config) {
5858
// We can't throw a checked exception here because it would break backward compatibility since
5959
// the calling method is executed in constructor of JdbcAdmin or JdbcService
6060
throw new RuntimeException(
61-
CoreError.JDBC_MYSQL_GETTING_CONNECTION_METADATA_FAILED.buildMessage(e), e);
61+
CoreError.JDBC_MYSQL_GETTING_CONNECTION_METADATA_FAILED.buildMessage(e.getMessage()), e);
6262
}
6363
}
6464
}

0 commit comments

Comments
 (0)