Skip to content

Commit

Permalink
chore: log class causing failure in frontend dependency scan
Browse files Browse the repository at this point in the history
Wraps the annotation finder function to log potential errors during
class scanning and the class that originates the failure.

References #19616
  • Loading branch information
mcollovati committed Jul 25, 2024
1 parent 763a530 commit 0a20dcc
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, clazz.getName(), exception);
throw exception;
}
};

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

0 comments on commit 0a20dcc

Please sign in to comment.