Skip to content

Commit 41fd9d7

Browse files
chore: log class causing failure in frontend dependency scan (#19721) (#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]>
1 parent 94b67dd commit 41fd9d7

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

flow-server/src/main/java/com/vaadin/flow/server/frontend/scanner/FullDependenciesScanner.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,17 @@ class FullDependenciesScanner extends AbstractDependenciesScanner {
111111
super(finder, featureFlags);
112112

113113
long start = System.currentTimeMillis();
114-
this.annotationFinder = annotationFinder;
114+
// Wraps the finder function to provide debugging information in case of
115+
// failures
116+
this.annotationFinder = (clazz, loadedAnnotation) -> {
117+
try {
118+
return annotationFinder.apply(clazz, loadedAnnotation);
119+
} catch (RuntimeException exception) {
120+
getLogger().error("Could not read {} annotation from class {}.",
121+
loadedAnnotation.getName(), clazz.getName(), exception);
122+
throw exception;
123+
}
124+
};
115125

116126
try {
117127
abstractTheme = finder.loadClass(AbstractTheme.class.getName());

0 commit comments

Comments
 (0)