This is an automated email from the ASF dual-hosted git repository. dimas pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push: new dcd68db0f Fix the issue where the Polaris Server exposes backend metadata in the error response body when the database is not bootstrapped. (#1837) dcd68db0f is described below commit dcd68db0fabe65896e26e830b5c0712b19d76724 Author: Bo Wang <bo.wang.11...@gmail.com> AuthorDate: Mon Jun 9 09:37:08 2025 -0700 Fix the issue where the Polaris Server exposes backend metadata in the error response body when the database is not bootstrapped. (#1837) --- .../impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java | 2 +- .../apache/polaris/service/exception/IcebergExceptionMapperTest.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java b/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java index 3731b6800..02997f37c 100644 --- a/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java +++ b/persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java @@ -194,7 +194,7 @@ public class PolarisEclipseLinkMetaStoreSessionImpl extends AbstractTransactiona if (e.toString().toLowerCase(Locale.ROOT).contains("duplicate key")) { throw new AlreadyExistsException("Duplicate key error when persisting entity", e); } else { - throw e; + throw new RuntimeException("Error persisting entity", e); } } } diff --git a/service/common/src/test/java/org/apache/polaris/service/exception/IcebergExceptionMapperTest.java b/service/common/src/test/java/org/apache/polaris/service/exception/IcebergExceptionMapperTest.java index a6fe4113f..4dd0d679d 100644 --- a/service/common/src/test/java/org/apache/polaris/service/exception/IcebergExceptionMapperTest.java +++ b/service/common/src/test/java/org/apache/polaris/service/exception/IcebergExceptionMapperTest.java @@ -69,7 +69,8 @@ public class IcebergExceptionMapperTest { new FileIOUnknownHostException( "mybucket.blob.core.windows.net: Name or service not known", new RuntimeException(new UnknownHostException())), - 404)), + 404), + Arguments.of(new RuntimeException("Error persisting entity"), 500)), cloudCodeMappings.entrySet().stream() .flatMap( entry ->