Skip to content

Commit a7f199c

Browse files
committed
Handle exceptions indicating broken jars
1 parent 61be85e commit a7f199c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/sbm-core/src/main/java/org/springframework/sbm/openrewrite/RewriteExecutionContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import lombok.Getter;
1919
import lombok.extern.slf4j.Slf4j;
2020
import org.openrewrite.InMemoryExecutionContext;
21+
import org.openrewrite.java.JavaParsingException;
2122
import org.openrewrite.maven.internal.MavenDownloadingException;
2223
import org.openrewrite.maven.internal.MavenParsingException;
2324
import org.springframework.context.ApplicationEventPublisher;
@@ -52,6 +53,10 @@ private static Consumer<Throwable> createErrorHandler() {
5253
log.warn(t.getMessage());
5354
} else if(t instanceof MavenDownloadingException) {
5455
log.warn(t.getMessage());
56+
} else if(t instanceof JavaParsingException) {
57+
if(t.getMessage().equals("Failed symbol entering or attribution")) {
58+
throw new RuntimeException("This could be a broken jar. Activate logging on WARN level for 'org.openrewrite' might reveal more information.", t);
59+
}
5560
} else {
5661
log.error("Exception occured!", t);
5762
}

0 commit comments

Comments
 (0)