[ 
https://issues.apache.org/jira/browse/CXF-7929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723052#comment-16723052
 ] 

Colm O hEigeartaigh commented on CXF-7929:
------------------------------------------

If you put a breakpoint here what happens?

[https://github.com/apache/cxf/blob/540bb76f6f3d3d23944c566905f9f395c6f86b79/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/SpecExceptions.java#L62]

If the status is 404 it should map the exception to NotFoundException. Have you 
confirmed by looking at the response message that it is returning a 404 status 
code?

> org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException 
> is changing actual error cause and error http status 
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-7929
>                 URL: https://issues.apache.org/jira/browse/CXF-7929
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.12
>            Reporter: Vijay Kumar
>            Priority: Major
>
> I would like to understand details of changing error / exception details
> org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:511)
>  at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901)
>  at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:862)
>  at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:427)
>  at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:607)
>  
> +*Scenario:*+ ** We are facing a scenario where my program throws an 
> exception with needful details as 
> cause: document with name <docName> not available in the repository
> errorCode: 404 
> as 
> java.lang.RuntimeException: Document with name <docName> not available in the 
> repository
> but from 
> org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException 
> method it is converted to 
> code: 500
> cause: Internal Server Error
> Due to this conversion we are not able to understand / catch actual cause of 
> the error / exception.
>  
> Fare Scenario:
>  # I have file in repo
> 2. i have rest client api to download (etc)
>  # My rest client api uses org.apache.cxf.jaxrs.client
>  # When there is no file to download, my api throwing an runtime exception 
> with a cause of details.
>  # however the exception is handled by 
> org.apache.cxf.jaxrs.client.WebClient.get() is modifying the exception 
> details as internal server error, 500.
> org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException(AbstractClient.java:511)
> at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:901)
> at org.apache.cxf.jaxrs.client.WebClient.doInvoke(WebClient.java:862)
> at org.apache.cxf.jaxrs.client.WebClient.invoke(WebClient.java:427)
> at org.apache.cxf.jaxrs.client.WebClient.get(WebClient.java:607)
>  
> Please be informed that i have gone through the class details of WebClient 
> and AbstractWebClient
>  
> Please let me know in case of any info needed.
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to