fix(serialize-generator): Print a better error message
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
ca21e3e826
commit
38a54455d7
|
@ -115,6 +115,7 @@ public class SerializeGeneratorProcessor extends AbstractProcessor2 {
|
||||||
case "adapter" -> {
|
case "adapter" -> {
|
||||||
if (bld.adapter != null) throw new IllegalArgumentException("Duplicate annotation parameter: adapter");
|
if (bld.adapter != null) throw new IllegalArgumentException("Duplicate annotation parameter: adapter");
|
||||||
if (value.getValue() instanceof TypeMirror tm) bld.adapter = tm;
|
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);
|
else throw new IllegalArgumentException("Unexpected value type: " + value.getValue().getClass() + " (with value " + value.getValue() + ") on " + element);
|
||||||
}
|
}
|
||||||
case "nullSafe" -> {
|
case "nullSafe" -> {
|
||||||
|
|
Loading…
Reference in New Issue