Skip to content

Commit dcd68db

Browse files
authored
Fix the issue where the Polaris Server exposes backend metadata in the error response body when the database is not bootstrapped. (#1837)
1 parent dccf676 commit dcd68db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

persistence/eclipselink/src/main/java/org/apache/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreSessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public <T> T runInTransaction(
194194
if (e.toString().toLowerCase(Locale.ROOT).contains("duplicate key")) {
195195
throw new AlreadyExistsException("Duplicate key error when persisting entity", e);
196196
} else {
197-
throw e;
197+
throw new RuntimeException("Error persisting entity", e);
198198
}
199199
}
200200
}

service/common/src/test/java/org/apache/polaris/service/exception/IcebergExceptionMapperTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ static Stream<Arguments> fileIOExceptionMapping() {
6969
new FileIOUnknownHostException(
7070
"mybucket.blob.core.windows.net: Name or service not known",
7171
new RuntimeException(new UnknownHostException())),
72-
404)),
72+
404),
73+
Arguments.of(new RuntimeException("Error persisting entity"), 500)),
7374
cloudCodeMappings.entrySet().stream()
7475
.flatMap(
7576
entry ->

0 commit comments

Comments
 (0)