Skip to content

Commit

Permalink
Backport to branch(3) : Revise feature names in error messages (#2335)
Browse files Browse the repository at this point in the history
Co-authored-by: Josh Wong <[email protected]>
Co-authored-by: brfrn169 <[email protected]>
  • Loading branch information
3 people authored Nov 14, 2024
1 parent 4fe9471 commit a185244
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/com/scalar/db/api/Admin.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,7 @@ default void addNewColumnToTable(
String namespace, String table, String columnName, DataType columnType, boolean encrypted)
throws ExecutionException {
if (encrypted) {
throw new UnsupportedOperationException(
CoreError.TRANSPARENT_DATA_ENCRYPTION_NOT_ENABLED.buildMessage());
throw new UnsupportedOperationException(CoreError.ENCRYPTION_NOT_ENABLED.buildMessage());
} else {
addNewColumnToTable(namespace, table, columnName, columnType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ public void createTable(
}

if (!metadata.getEncryptedColumnNames().isEmpty()) {
throw new UnsupportedOperationException(
CoreError.TRANSPARENT_DATA_ENCRYPTION_NOT_ENABLED.buildMessage());
throw new UnsupportedOperationException(CoreError.ENCRYPTION_NOT_ENABLED.buildMessage());
}

try {
Expand Down Expand Up @@ -248,8 +247,7 @@ public void repairTable(
String namespace, String table, TableMetadata metadata, Map<String, String> options)
throws ExecutionException {
if (!metadata.getEncryptedColumnNames().isEmpty()) {
throw new UnsupportedOperationException(
CoreError.TRANSPARENT_DATA_ENCRYPTION_NOT_ENABLED.buildMessage());
throw new UnsupportedOperationException(CoreError.ENCRYPTION_NOT_ENABLED.buildMessage());
}

try {
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/com/scalar/db/common/error/CoreError.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public enum CoreError implements ScalarDbError {
AUTH_NOT_ENABLED(
Category.USER_ERROR,
"0022",
"ScalarDB Auth is not enabled. To use ScalarDB Auth, you must enable it. Note that this feature is supported only in the ScalarDB Enterprise edition",
"The authentication and authorization feature is not enabled. To use this feature, you must enable it. Note that this feature is supported only in the ScalarDB Enterprise edition",
"",
""),
CONDITION_BUILD_ERROR_CONDITION_NOT_ALLOWED_FOR_PUT_IF(
Expand Down Expand Up @@ -647,10 +647,10 @@ public enum CoreError implements ScalarDbError {
+ "If you want to modify a condition, please use clearConditions() to remove all existing conditions first",
"",
""),
TRANSPARENT_DATA_ENCRYPTION_NOT_ENABLED(
ENCRYPTION_NOT_ENABLED(
Category.USER_ERROR,
"0143",
"ScalarDB Transparent Data Encryption is not enabled. To use ScalarDB Transparent Data Encryption, you must enable it. Note that this feature is supported only in the ScalarDB Enterprise edition",
"The encryption feature is not enabled. To encrypt data at rest, you must enable this feature. Note that this feature is supported only in the ScalarDB Enterprise edition",
"",
""),
INVALID_VARIABLE_KEY_COLUMN_SIZE(
Expand Down

0 comments on commit a185244

Please sign in to comment.