Skip to content

Commit 944f23e

Browse files
committed
Include stub with exception when failing to parse as Java
1 parent 466964c commit 944f23e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

rewrite-java/src/main/java/org/openrewrite/java/internal/template/JavaTemplateParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ private JavaSourceFile compileTemplate(@Language("java") String stub) {
276276
.findFirst()
277277
.filter(JavaSourceFile.class::isInstance) // Filters out ParseErrors
278278
.map(JavaSourceFile.class::cast)
279-
.orElseThrow(() -> new IllegalArgumentException("Could not parse as Java"));
279+
.orElseThrow(() -> new IllegalArgumentException("Could not parse as Java:\n" + stub));
280280
}
281281

282282
/**

0 commit comments

Comments
 (0)