#19684 raised an interesting requirement to provide more information in health check failure messages. The specific goal there was to include the name of the bean for which the health check has failed. This would help to pinpoint the problem in applications with multiple beans of the same type that are all being health-checked.
This issue is to track adding support for the above requirement in a more general-purpose manner. We may be able to make use of the existing constructor that takes a Function<Exception, String> to produce the error message.