Skip to content

Commit

Permalink
chore: log class causing failure in frontend dependency scan (#19721) (
Browse files Browse the repository at this point in the history
…#19725)

Wraps the annotation finder function to log potential errors during
class scanning and the class that originates the failure.

References #19616

Co-authored-by: Marco Collovati <[email protected]>
  • Loading branch information
vaadin-bot and mcollovati authored Jul 26, 2024
1 parent 94b67dd commit 41fd9d7
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,17 @@ class FullDependenciesScanner extends AbstractDependenciesScanner {
super(finder, featureFlags);

long start = System.currentTimeMillis();
this.annotationFinder = annotationFinder;
// Wraps the finder function to provide debugging information in case of
// failures
this.annotationFinder = (clazz, loadedAnnotation) -> {
try {
return annotationFinder.apply(clazz, loadedAnnotation);
} catch (RuntimeException exception) {
getLogger().error("Could not read {} annotation from class {}.",
loadedAnnotation.getName(), clazz.getName(), exception);
throw exception;
}
};

try {
abstractTheme = finder.loadClass(AbstractTheme.class.getName());
Expand Down

0 comments on commit 41fd9d7

Please sign in to comment.