-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
2.3.5.Final, 3.1.4.Final
-
-
Workaround Exists
-
When using a custom exception mapper in conjunction with caching (using resteasy-cache-core), caching can break. Let my explain in greater details.
When a Not-Modified (304) response must be issued for a given request, it is processed via the class ServerCacheInterceptor. In this class, when it determines that content was not modified, it uses a NoLogWebApplicationException an attach into it the Not-Modified (304) response.
This exception will then makes it way to the SynchronousDispatcher class which is responsible of handling exceptions. Normally, this class will trap the exception in the method handleWebApplicationException which will return the Not-Modified (304) response that is inside the exception.
However, when you setup an execution mapper, the newly configure exception mapper will be used to process the exception. If the custom exception mapper is not coded to handle the case that a NoLogWebApplicationException can contain a Not-Modified (304) response, it will break caching.
In my opinion, the transportation of the Not-Modified (304) response must be done in a different manner so it does not interfer with custom exception mapper.
The current way imposed to the custom exception mapper to be aware of the caching behavior of the NoLogWebApplicationException.