cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <gma...@talend.com>
Subject Re: ExceptionMapper vs Interceptor
Date Sat, 05 Feb 2011 10:00:34 GMT
ExceptionMapper is also portable across different REST implementations.  
Usage of interceptors for exception handling may lead to nonstandard, 
project-specific methods of handling exceptions (may need to document 
more for other developers to understand).

Glen

On 05.02.2011 00:48, dineshviswanath@gmail.com wrote:
> Hi All,
> I wanted to know the pros and cons of using Exception Mapper and Interceptor
> in CXF REST service. Below I have listed some of the pros and cons with my
> limited knowledge on CXF Rest API. Please correct me if am wrong.
>
> Also Please suggest me which is the best way of handling the exception.
>
>
> 1. Exception mapper:
> Pros:
> ExceptionMapper can map the exception to the certain response without
> acknowledging the JAXRSInvoker that exception occurred.
> Cons:
> We cannot map the all runtime (un-checked) exception to the response.
> i.e, ExceptionMapper is not able to map the all runtime exception. I tried
> this :-)
>
> 2. Interceptor:
> Pros:
> Cons:
> JAXRSInvoker will know that exception occurred and it will try to construct
> the response.
>
>
>
>


-- 
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza



Mime
View raw message