| Currently, when an error occurs while generating metadata from annotations, the context we display in the error message is limited to whatever parameters are accepted by the logging method; generally it's only the entity type and the field name, sometimes only the field name. This can be confusing in some situations. Most importantly, when processing indexed embeddeds, error messages are not clear about the fact that we are actually processing an indexed embedded. See
HSEARCH-2536 Open for an example of how that can make us waste time. Personally I would use nested exceptions to do that, because this would easily solve this issue, but I may be the only one to like this solution because "people hate deep stack traces" (https://github.com/hibernate/hibernate-search/pull/1168). Thus we may want to look for a generic way to store, and later display, the context of errors during annotation processing, like we did with org.hibernate.search.bridge.spi.ConversionContext or org.hibernate.search.elasticsearch.schema.impl.ValidationContext. |