try to report more info from annotation processor failure

This commit is contained in:
Gavin King 2024-02-14 14:42:48 +01:00
parent 8dd0ef5198
commit f111d1a1a1
1 changed files with 6 additions and 1 deletions

View File

@ -208,7 +208,12 @@ public class JPAMetaModelEntityProcessor extends AbstractProcessor {
createMetaModelClasses();
}
catch (Exception e) {
context.logMessage( Diagnostic.Kind.ERROR, "Error generating JPA metamodel: " + e.getMessage() );
final Throwable cause = e.getCause();
final String message =
cause != null && cause != e
? e.getMessage() + " caused by " + cause.getMessage()
: e.getMessage();
context.logMessage( Diagnostic.Kind.ERROR, "Error generating JPA metamodel: " + message );
}
}
return ALLOW_OTHER_PROCESSORS_TO_CLAIM_ANNOTATIONS;