You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2011/08/13 13:17:27 UTC

[jira] [Commented] (CAMEL-4325) Wrong exception uri when an HTTP error code is returned

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

Claus Ibsen commented on CAMEL-4325:
------------------------------------

Thanks for reporting Cedric do you want to try to work on a patch? with an unit test that reproduces the issue and proves the fix works as expected?

> Wrong exception uri when an HTTP error code is returned
> -------------------------------------------------------
>
>                 Key: CAMEL-4325
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4325
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>
> When a REST service returns an HTTP error code (e.g. 404), the URI property of the exception is incorrect.
> The URI is the URI of the origin endpoint of the route.
> It should be instead the URI of the endpoint that threw the exception.
> For instance, in the following route :
> {code:xml}
> <route id="restproxy">           
>     <from uri="restlet:http://localhost:9080/oe/ws/offre/{id}"/>           
>     <doTry>
>         <to uri="restlet:http://bla.dot.com:8080/oe/ws/offre/{id}"/>
>         <doCatch>
>             <exception>org.apache.camel.CamelException</exception>
>             <log message="URI=${exception.uri}"/>
>         </doCatch>
>     </doTry>
> </route>
> {code}
> The logged URI is "restlet:http://localhost:9080/oe/ws/offre/{id}" but should be instead the real URI used, e.g. "restlet:http://bla.dot.com:8080/oe/ws/offre/1".
> This bug might be fixed by the following code change in class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException() :
>    - String uri = exchange.getFromEndpoint().getEndpointUri();
>    + String uri = response.getRequest().getResourceRef()

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira