Skip to content

Commit dd5f22b

Browse files
dsolistorresclaude
andcommitted
style(health): throw IllegalStateException instead of raw Exception (#35602)
Addresses PR #35771 review feedback — a specific unchecked type communicates intent more clearly than a raw checked Exception. The surrounding measureExecution(...) machinery still catches it as Exception, so behavior is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4ab51b8 commit dd5f22b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

dotCMS/src/main/java/com/dotcms/health/checks/cdi/VelocityHealthCheck.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ protected CheckResult performCheck() throws Exception {
8484
engine.evaluate(new VelocityContext(), writer, PROBE_LOG_TAG, PROBE_TEMPLATE);
8585
final String rendered = writer.toString();
8686
if (rendered.contains(LITERAL_MARKER)) {
87-
throw new Exception("Velocity global macro library not registered: "
87+
throw new IllegalStateException(
88+
"Velocity global macro library not registered: "
8889
+ "probe template rendered as literal text. See issues #35329 / #35601.");
8990
}
9091
return "Velocity macro library registered (#renderMarks resolved)";

0 commit comments

Comments
 (0)