I am writing a jaxrs app, which uses interceptors to validate the input, as
well as check authentication and authorization of the calling user.
Essentially, my API is annotated such that some arguments can't be null, or
must be within certain range etc, which is enforced by an in-interceptor at
PRE_INVOKE phase. Then I also have the auth checker (subclass of
org.apache.cxf.interceptor.security.AbstractAuthorizingInInterceptor, which
again runs at the same phase). Both of those throw exceptions when they see
something that they do not like. My app also throws exceptions, when
anything goes wrong. My interceptors work just fine. Both authentication
issues as well as input issues are handled properly, by throwing an
exception.My exception mapper is capable of handling exception types thrown
by interceptors as well as from the app. When the App throws the exception,
the exception mapper is called just fine, and I can see a response with a
proper error code and message returned. However, when any of the
interceptors throw an exception, the mapper is not called, and I get an ugly
backtrace with error code of 500.What am I missing? I did find a few similar
questions, though each had a different take, and I did not think any of them
apply. The question boils down to is it possible to map exceptions thrown in
phases other than invoke.Thanks.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/ExceptionMapper-is-not-called-for-exceptions-thrown-from-an-interceptor-tp5729698.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to