Vijay Kumar created CXF-7929:
--------------------------------

             Summary: 
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


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