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

[jira] [Created] (CAMEL-4324) Response body lost when an HTTP error code is returned

Response body lost when an HTTP error code is returned
------------------------------------------------------

                 Key: CAMEL-4324
                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
             Project: Camel
          Issue Type: Bug
          Components: camel-restlet
    Affects Versions: 2.8.0, 2.7.0, 2.6.0
            Reporter: Cedric de Launois


When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement :
   String copy = response.toString();

that should be instead something like :
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }


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

        

[jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Cedric de Launois (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cedric de Launois updated CAMEL-4324:
-------------------------------------

    Description: 
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
{code}
   String copy = response.toString();
{code}

that should be instead something like :
{code}
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }
{code}



  was:
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
   String copy = response.toString();

that should be instead something like :
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }



> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             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) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Commented] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Cedric de Launois (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084635#comment-13084635 ] 

Cedric de Launois commented on CAMEL-4324:
------------------------------------------

Claus, I won't be able to work on this for the next 3 weeks. If it is ok for you to wait, then I will work on the patch.

> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>            Priority: Minor
>             Fix For: 2.9.0
>
>
> When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Cedric de Launois (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cedric de Launois updated CAMEL-4324:
-------------------------------------

    Description: 
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
{code}
   String copy = response.toString();
{code}

that should be instead something like :
{code}
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }
{code}



  was:
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

{code:xml}
<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>
{code}

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
{code}
   String copy = response.toString();
{code}

that should be instead something like :
{code}
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }
{code}




> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             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) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Cedric de Launois (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cedric de Launois updated CAMEL-4324:
-------------------------------------

    Description: 
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

{code:xml}
<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>
{code}

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
{code}
   String copy = response.toString();
{code}

that should be instead something like :
{code}
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }
{code}



  was:
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
{code}
   String copy = response.toString();
{code}

that should be instead something like :
{code}
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }
{code}




> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             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) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> {code:xml}
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> {code}
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Commented] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13084589#comment-13084589 ] 

Claus Ibsen commented on CAMEL-4324:
------------------------------------

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?

> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>             Fix For: 2.9.0
>
>
> When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Assigned] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang reassigned CAMEL-4324:
-----------------------------------

    Assignee: Willem Jiang

> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.9.0
>
>
> When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-4324:
-------------------------------

                Priority: Minor  (was: Major)
    Estimated Complexity: Novice  (was: Moderate)
           Fix Version/s: 2.9.0

> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>            Priority: Minor
>             Fix For: 2.9.0
>
>
> When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Cedric de Launois (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cedric de Launois updated CAMEL-4324:
-------------------------------------

    Description: 
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
   String copy = response.toString();

that should be instead something like :
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }


  was:
When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :

<doTry>
    <to uri="restlet:http://my.service.com/ws/{id}"/>
    <doCatch>
        <exception>org.apache.camel.CamelException</exception>
        <log message="body is : ${exception.responseBody}"/>
    </doCatch>
</doTry>

The problem is probably due to the statement :
   String copy = response.toString();

that should be instead something like :
   String copy = null;
   if (response.getEntity() != null) {
       // get content text
       copy = response.getEntity().getText();
   }



> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             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) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
>    String copy = response.toString();
> that should be instead something like :
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }

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

        

[jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CAMEL-4324:
-------------------------------

    Fix Version/s: 2.8.2

> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.8.2, 2.9.0
>
>
> When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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

        

[jira] [Resolved] (CAMEL-4324) Response body lost when an HTTP error code is returned

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Willem Jiang resolved CAMEL-4324.
---------------------------------

    Resolution: Fixed

Applied patch into trunk.

> Response body lost when an HTTP error code is returned
> ------------------------------------------------------
>
>                 Key: CAMEL-4324
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4324
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-restlet
>    Affects Versions: 2.6.0, 2.7.0, 2.8.0
>            Reporter: Cedric de Launois
>            Assignee: Willem Jiang
>            Priority: Minor
>             Fix For: 2.9.0
>
>
> When a REST service returns an HTTP error code (e.g. 404) with some content in the response body, this body is not correctly copied into the exception.
> This results e.g. in ${exception.responseBody} having a value like "org.restlet.data.Response@17bf0a7" in the following route fragment :
> <doTry>
>     <to uri="restlet:http://my.service.com/ws/{id}"/>
>     <doCatch>
>         <exception>org.apache.camel.CamelException</exception>
>         <log message="body is : ${exception.responseBody}"/>
>     </doCatch>
> </doTry>
> The problem is probably due to the statement (class org.apache.camel.component.restlet.RestletProducer, method populateRestletProducerException) :
> {code}
>    String copy = response.toString();
> {code}
> that should be instead something like :
> {code}
>    String copy = null;
>    if (response.getEntity() != null) {
>        // get content text
>        copy = response.getEntity().getText();
>    }
> {code}

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