Is a ContainerResponseFilter thrown if an exception is thrown somewhere in the controller?

I have a RestEasy based service in which I do some cleaning work in a ContainerResponseFilter. The problem is that if an unknown exception at runtime (i.e. an exception for which I do not have a mapmaker) is thrown by the resource, the ContainerResponseFilter is never thrown. Is this expected behavior? Is there a workaround? I was looking at the following question (Jonas answer):
How can I log excluded exceptions in my RESTful JAX-RS web service?

and it showed that the ContainerResponseFilter is executed even when an exception is thrown in the controller?

Did I miss something?

+4
source share

Source: https://habr.com/ru/post/1610660/


All Articles