Skip to content

Commit 63a5584

Browse files
committed
Fix CoreError message parameter mismatches (#3164)
1 parent e096ae9 commit 63a5584

File tree

5 files changed

+6
-9
lines changed

5 files changed

+6
-9
lines changed

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

Lines changed: 2 additions & 2 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(
@@ -974,7 +974,7 @@ public enum CoreError implements ScalarDbError {
974974
CONSENSUS_COMMIT_RECOVERING_RECORDS_FAILED(
975975
Category.INTERNAL_ERROR, "0057", "Recovering records failed. Details: %s", "", ""),
976976
CONSENSUS_COMMIT_COMMITTING_RECORDS_FAILED(
977-
Category.INTERNAL_ERROR, "0058", "Committing records failed", "", ""),
977+
Category.INTERNAL_ERROR, "0058", "Committing records failed. Details: %s", "", ""),
978978

979979
//
980980
// Errors for the unknown transaction status error category

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
@@ -53,8 +53,7 @@ public void handle(Delete delete) throws ExecutionException {
5353
throw new NoMutationException(CoreError.NO_MUTATION_APPLIED.buildMessage(), e);
5454
} catch (TransactionConflictException e) {
5555
throw new RetriableExecutionException(
56-
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(
57-
e.getMessage(), e),
56+
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(e.getMessage()),
5857
e);
5958
} catch (DynamoDbException e) {
6059
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
@@ -54,8 +54,7 @@ public void handle(Put put) throws ExecutionException {
5454
throw new NoMutationException(CoreError.NO_MUTATION_APPLIED.buildMessage(), e);
5555
} catch (TransactionConflictException e) {
5656
throw new RetriableExecutionException(
57-
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(
58-
e.getMessage(), e),
57+
CoreError.DYNAMO_TRANSACTION_CONFLICT_OCCURRED_IN_MUTATION.buildMessage(e.getMessage()),
5958
e);
6059
} catch (DynamoDbException e) {
6160
throw new ExecutionException(

core/src/main/java/com/scalar/db/transaction/consensuscommit/CommitHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ void onePhaseCommitRecords(TransactionContext context)
293293
context.transactionId);
294294
} catch (ExecutionException e) {
295295
throw new UnknownTransactionStatusException(
296-
CoreError.CONSENSUS_COMMIT_COMMITTING_RECORDS_FAILED.buildMessage(),
296+
CoreError.CONSENSUS_COMMIT_COMMITTING_RECORDS_FAILED.buildMessage(e.getMessage()),
297297
e,
298298
context.transactionId);
299299
}

0 commit comments

Comments
 (0)