Skip to content

Commit

Permalink
Refine BeanValidationBeanRegistrationAotProcessor logging
Browse files Browse the repository at this point in the history
This commit print a log message at debug level without
a stacktrace for TypeNotPresentException and uses
warn level instead of error level for other exceptions
since the processing of such bean will be just skipped.

Closes spring-projectsgh-31147
  • Loading branch information
sdeleuze committed Sep 8, 2023
1 parent eda35e8 commit 69cc661
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -105,8 +105,12 @@ public static BeanRegistrationAotContribution processAheadOfTime(RegisteredBean
logger.warn("Skipping validation constraint hint inference for bean " + registeredBean.getBeanName() +
" due to an ArrayIndexOutOfBoundsException at validator level");
}
else if (ex instanceof TypeNotPresentException) {
logger.debug("Skipping validation constraint hint inference for bean " +
registeredBean.getBeanName() + " due to a TypeNotPresentException at validator level: " + ex.getMessage());
}
else {
logger.error("Skipping validation constraint hint inference for bean " +
logger.warn("Skipping validation constraint hint inference for bean " +
registeredBean.getBeanName(), ex);
}
return null;
Expand Down

0 comments on commit 69cc661

Please sign in to comment.