You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2019/01/18 17:17:01 UTC

[jira] [Resolved] (CXF-7929) org.apache.cxf.jaxrs.client.AbstractClient.convertToWebApplicationException is changing actual error cause and error http status

     [ https://issues.apache.org/jira/browse/CXF-7929?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh resolved CXF-7929.
--------------------------------------
    Resolution: Cannot Reproduce

We need a test-case of some sort to take this further.

> 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
>         Attachments: image-2018-12-20-10-35-19-884.png, image-2018-12-26-16-16-02-352.png, image-2018-12-26-16-21-15-698.png
>
>
> 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)