See bug #149136 comment #29 and the patch it refers to. While it would not be thrown directly from LayerBuilder utility methods, there are other places where processors throw LGE themselves and it would be useful to specify the particular annotation so as to produce better error links.
Created attachment 109496 [details]
Running patch ('hg pdi LayerGenerationException_194545' to refresh)
Please review this proposed patch. It makes it possible to specify more precisely where an AP error occurred. (It is up to the Messager impl to take advantage of this information in producing more accurate line numbers.)
Note that the Annotation parameter is currently only searched for among direct annotations of the element, but this is used rather than Class<? extends Annotation> to allow an enhanced impl to find nested annotations; see commented-out test case.
Integrated into 'main-golden'
User: Jesse Glick <firstname.lastname@example.org>
Log: #194545: constructors for LayerGenerationException specifying responsible annotation.