Skip to content

Commit 46bafb7

Browse files
committed
Don't peel off PolicyParserException
1 parent 9d70624 commit 46bafb7

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyUtils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ public static Policy parseEncodedPolicyIfExists(
110110
version
111111
);
112112
}
113-
} catch (PolicyParserException e) {
114-
// This is more specific and informative than a generalized IllegalStateException
115-
throw e;
116113
} catch (IOException | RuntimeException e) {
117114
throw new IllegalStateException("Unable to parse policy patch for layer [" + layerName + "]", e);
118115
}

libs/entitlement/src/test/java/org/elasticsearch/entitlement/runtime/policy/PolicyUtilsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public void testNoPatchWithParsingError() {
171171
);
172172

173173
assertThrows(
174-
PolicyParserException.class,
174+
IllegalStateException.class,
175175
() -> PolicyUtils.parseEncodedPolicyIfExists(base64EncodedPolicy, "9.0.0", true, "test-plugin", Set.of())
176176
);
177177
}

0 commit comments

Comments
 (0)