I've got a REST service that returns error messages as JSON like this:
{
"errorMessages": ["foo", "bar"]
}
When I create a client proxy and call that service, I don't see any error
message in the exceptions (I might get a NotFoundException with no message
for instance). That's understandable, since how in the heck would CXF know
how to convert my JSON into something readable? Anyway, I would like to
help CXF along here and get the right error message to it (maybe "foo, bar"
in the above example) so that it can include it in the constructor for
NotFoundException. I'm thinking ClientResponseFilter might be the way to
go, but thought I'd check in with you guys before I go too far down the
rabbit hole. I've tried throwing an exception from my "filter" method and
CXF doesn't appear to really like that idea. Any thoughts/guidance?
Thanks,
James