On 11/20/2012 5:42 AM, Sergey Beryozkin wrote:
Let me summarize.
One one hand the spec provides for the optimization in cases where WAE
Response entity is not null. On the other hand, this optimization leads
to the issue where an application code reports WAE with Response having
an entity and also with the cause exception for the benefit of the WAE
I'd like to propose one of the following:
1. Keep the current optimization in place but update the spec to say
that "if WAE Response entity is null or WAE cause exception is not null
- use the mapper, otherwise - use WAE Response entity directly"
2. Drop the optimization - I'd expect any custom mapper check WAE
Response anyway before creating some custom Response instead and
dropping this optimization would require a mapper to check if entity is
not null - guess most of the mappers do it all the time anyway...
In Resteasy, we allow you to write a mapper for any exception class, so
I vote #2.
[jsr339-experts] Re: [jax-rs-spec users] WebApplicationException Response entity and exception mappers