I have a service which takes request body in Json format.
It is working fine when request body is in proper Json format.

When the request body has wrong data, CXF is throwing 500(Internal server
error) response.

The reason is readFrom api in JsonProvider is throwing default
WebApplicationError in case of exception.
http://svn.apache.org/repos/asf/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java


I want to throw 400(Bad request) in this case.
What is the best way to achieve this?

Thanks,
Govind

Reply via email to