Hi Gabo

I've added an exception mapper [1] which changes 404 to 405 and adds an
error message and is registered in [2], added testGetBookNonExistent() to
[3], seems to work fine...

Can you please try to download the source for 2.2.3 and put a breakpoint in
your exception mapper and then see what is happening afterwards ?

some more comments


>> I've tried updating the status code in [1] from 500 to 401 and saw a test
>> [3] failing.
>>   
>What do you mean by the test failing? Failing with a 401 or a 500 error 
code?

That test has been written to check for 500. After changing an exception
mapper to set the status code to 401 I could see that the test was failing,
therefore the status which is set in the mapper was not ignored

> Do I need to have that setToHandle in the mapper implementation class?

No, I think that flag is used there to test two different scenarios, when an
exception is mapped by a custom mapper and when it's handled by the runtime

thanks, Sergey  

[1]
http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/RuntimeExceptionMapper.java
[2] 
[3]
http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java


Gabo Manuel wrote:
> 
> Hi Sergey,
> 
> Sergey Beryozkin wrote:
>> Hi Gabo
>>
>> I'm wondering, how I can reproduce it...
>> I have two exception mappers in the system tests area, the first one
>> catching an application exception, 
>> the second one a spring security exception.
>>
>> I've tried updating the status code in [1] from 500 to 401 and saw a test
>> [3] failing.
>>   
> What do you mean by the test failing? Failing with a 401 or a 500 error 
> code?
> 
> S.B > test has been written to check for 500. After changing
> 
>> Can you help me to reproduce the issue you're seeing ? A very simple test
>> case would be handy...
>>   
> All look the same except for the test scenario that I encountered. In 
> testGetBook123, try using
> 
> http://localhost:9080/webapp/bookstore/nonexistent/
> 
> 
> Do I need to have that setToHandle in the mapper implementation class?
> 
> Thanks,
> 
> Gabo
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-CXF2.2.3--On-exception-handling-tp24859798p24931888.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to