Skip to content

Commit 2c1933c

Browse files
authored
Better error message when sibling resolution fails (#1253)
* better error * autolint * better message
1 parent 226774b commit 2c1933c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

service/common/src/main/java/org/apache/polaris/service/catalog/iceberg/IcebergCatalog.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,9 +1113,12 @@ private void validateNoLocationOverlap(
11131113
new ResolverPath(Arrays.asList(ns.levels()), PolarisEntityType.NAMESPACE), ns));
11141114
ResolverStatus status = resolutionManifest.resolveAll();
11151115
if (!status.getStatus().equals(ResolverStatus.StatusEnum.SUCCESS)) {
1116-
throw new IllegalStateException(
1117-
"Unable to resolve sibling entities to validate location - could not resolve"
1118-
+ status.getFailedToResolvedEntityName());
1116+
String message =
1117+
"Unable to resolve sibling entities to validate location - " + status.getStatus();
1118+
if (status.getStatus().equals(ResolverStatus.StatusEnum.ENTITY_COULD_NOT_BE_RESOLVED)) {
1119+
message += ". Could not resolve entity: " + status.getFailedToResolvedEntityName();
1120+
}
1121+
throw new IllegalStateException(message);
11191122
}
11201123

11211124
StorageLocation targetLocation = StorageLocation.of(location);

0 commit comments

Comments
 (0)