iamhucong commented on code in PR #30900:
URL: https://github.com/apache/shardingsphere/pull/30900#discussion_r1567448234


##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/merge/dql/EncryptMergedResult.java:
##########
@@ -66,7 +69,14 @@ public Object getValue(final int columnIndex, final Class<?> 
type) throws SQLExc
         EncryptColumn encryptColumn = 
encryptRule.getEncryptTable(originalTableName).getEncryptColumn(originalColumnName);
         String schemaName =
                 
selectStatementContext.getTablesContext().getSchemaName().orElseGet(() -> new 
DatabaseTypeRegistry(selectStatementContext.getDatabaseType()).getDefaultSchemaName(database.getName()));
-        return encryptColumn.getCipher().decrypt(database.getName(), 
schemaName, originalTableName, originalColumnName, cipherValue);
+        try {
+            return encryptColumn.getCipher().decrypt(database.getName(), 
schemaName, originalTableName, originalColumnName, cipherValue);
+            // CHECKSTYLE:OFF
+        } catch (final Exception ex) {

Review Comment:
   AES is found to throw a GeneralSecurityException, which is a checked 
exception and would be inconvenient to wrap as a runtime exception. 
Additionally, considering the custom algorithm, it is challenging to predict 
the exact exception type.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to