A little explanation before:
I had a problem with my custom logging implementation (based on a ServletFilter) which is caused by the fact that the HttpHeader entries are applied at the HttpServletResponse right before the message body is written.
Therefore I wanted to implement a PostProcessInterceptor which applies the necessary HttpHeader entries, which are already contained in the ServerResponse, at the injected HttpServletResponse.
If the resource does not throw an exception my implementation works as expected.
If an exception is thrown and an ExceptionMapper is creating the response, the PostProcessInterceptor chain is not traversed.
In my opinion the problem is caused by the following line in resteasy-jaxrs:
The interceptor chain is not applied to the created Response before writing / sending it.
My question is now:
Is this an expected behavior? In my opinion the interceptor chain should be traversed in every case.
I didn't create a new issue in the resteasy jira because I'm not sure if this behavior is expected.
My current workaround:
Currently I create the interceptor, inject the properties and add it to the response within my abstract ExceptionMapper implementation. (<-- quite ugly, I know...)
Thanking you in anticipation.
Did you ever find out if this behavior is expected? I've run into the same issue, and I don't want to pollute my ExceptionMappers with code that really only belongs in a PostProcessInterceptor, but, like you, I don't really see any other option...