users@jersey.java.net

[Jersey] Catch marshaling errors and present in one go

From: naresh <baliga_naresh_at_yahoo.com>
Date: Thu, 26 Mar 2015 01:30:16 -0700 (MST)

Hi,
I'm using Jersey 2.17 and am using Jackson with JAXB annotations on my
representations.

These annotations are used for producing and consuming JSON as well as XML.

If a user POSTs a String to a data member (buried deep inside my
representation object) that is a Double, I wish to catch the resulting
marshal error and return a nicely formatted message.

I want to catch *all* such marshaling errors before presenting my error
response back, so that there is complete feedback to the user on what they
need to correct in their POST.

All I can do currently is map the resulting exception and present an error
for the first such encountered marshaling error.



--
View this message in context: http://jersey.576304.n2.nabble.com/Catch-marshaling-errors-and-present-in-one-go-tp7583221.html
Sent from the Jersey mailing list archive at Nabble.com.