Refine BeanValidationBeanRegistrationAotProcessor logging

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 gh-31147
This commit is contained in:
Sébastien Deleuze
2023-09-08 10:37:08 +02:00
parent eda35e8074
commit ab48b88f91

View File

@@ -105,8 +105,12 @@ class BeanValidationBeanRegistrationAotProcessor implements BeanRegistrationAotP
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;