I have a resource that is using the Jackson deserialization to convert
JSON to an object like this:
@POST
@Path ("/foobar")
public Response add(Foo aFoo)
{
....
}
If the JSON is not well formatted, I would like to catch and handle the
exception that is thrown by Jackson. Is there a way to do this? I have
tried using @Provider to catch Exception or Throwable or even the
specific Jackson exceptions, but the provider is never called.
Is there a way to do this, or do I have to deserialize by hand with in
the resource method?
Thanks for your help