Currently, failure of a POST or PUT request due to a desearilization problem results in 400 response code along with the unmarshalling exception in the response body, for example: "HTTP Status 400 - javax.xml.bind.UnmarshalException..." This behavior is the same for all content types (XML, json, yaml).
I would like to be able to intercept the deserialization failure and add extra information to the error message. This information will be retrieved from a meta-data file which describes our API capabilities. I have not been able to find a suitable RestEasy or Jboss interception point, or some way to extend a RestEasy class, that would help me achieve this. I'd appreciate some advice on this issue.
Thanks,
Ori.
|