fix(serialize-generator): Print a better error message
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Johannes Frohnmeyer 2024-04-24 16:10:17 +02:00
parent ca21e3e826
commit 38a54455d7
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 1 additions and 0 deletions

View File

@ -115,6 +115,7 @@ public class SerializeGeneratorProcessor extends AbstractProcessor2 {
case "adapter" -> {
if (bld.adapter != null) throw new IllegalArgumentException("Duplicate annotation parameter: adapter");
if (value.getValue() instanceof TypeMirror tm) bld.adapter = tm;
else if (value.getValue() instanceof String s && s.equals("<error>")) throw new IllegalArgumentException("Unexpected value type on " + element + ". Did you forget to import it?");
else throw new IllegalArgumentException("Unexpected value type: " + value.getValue().getClass() + " (with value " + value.getValue() + ") on " + element);
}
case "nullSafe" -> {