I’m trying to use the @Catch annotation to catch any JAXB UnmarshalExceptions generated in my application. I tried using the code described in the Play Documentation for @Catch:
@Catch(UnmarshalException.class)
public static void addUnmarshalError() {...}
and
@Catch(value = UnmarshalException.class, priority = 1)
public static void addUnmarshalError() {...}
but neither works.
Each time I use the annotation I get the message:
Oops: IllegalArgumentException
An unexpected error occured caused by exception IllegalArgumentException: wrong number of arguments
I don’t think it’s the code inside the method, since even an empty method body generates the exception. Is there something I’m missing in my @Catch call?
Your method should take a throwable as a parameter: