Skip to content

Commit

Permalink
Refine BeanValidationBeanRegistrationAotProcessor logging
Browse files Browse the repository at this point in the history
This commit prints 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 just be skipped.

Closes spring-projectsgh-31147
  • Loading branch information
sdeleuze committed Sep 8, 2023
1 parent eda35e8 commit ab48b88
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 ab48b88

Please sign in to comment.