lasdf1234 commented on code in PR #13034:
URL: https://github.com/apache/gravitino/pull/13034#discussion_r3966011608
##########
iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/utils/IcebergCatalogUtil.java:
##########
@@ -187,10 +193,11 @@ private static JdbcCatalog loadJdbcCatalog(IcebergConfig
icebergConfig) {
jdbcCatalog.initialize(icebergCatalogName, properties);
} catch (UncheckedSQLException e) {
Throwable cause = e.getCause();
- if (cause instanceof SQLException
- && cause.getMessage() != null
- && cause.getMessage().contains("Access denied")) {
- throw new ConnectionFailedException(e, e.getMessage());
+ if (cause instanceof SQLException) {
+ String sqlState = ((SQLException) cause).getSQLState();
+ if (sqlState != null &&
sqlState.startsWith(INVALID_AUTHORIZATION_SQLSTATE_CLASS)) {
Review Comment:
Got. Use accurate Sql code to fix it.
--
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]