Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 97E0E89E5 for ; Wed, 10 Aug 2011 14:23:50 +0000 (UTC) Received: (qmail 33668 invoked by uid 500); 10 Aug 2011 14:23:50 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 33583 invoked by uid 500); 10 Aug 2011 14:23:49 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 33573 invoked by uid 99); 10 Aug 2011 14:23:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2011 14:23:49 +0000 X-ASF-Spam-Status: No, hits=-2000.8 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2011 14:23:47 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 47567B57C7 for ; Wed, 10 Aug 2011 14:23:27 +0000 (UTC) Date: Wed, 10 Aug 2011 14:23:27 +0000 (UTC) From: "Cedric de Launois (JIRA)" To: dev@camel.apache.org Message-ID: <735380288.23846.1312986207288.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1279537636.23777.1312985007145.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CAMEL-4324) Response body lost when an HTTP error code is returned MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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 : org.apache.camel.CamelException 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} org.apache.camel.CamelException {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 : > > > > org.apache.camel.CamelException > > > > 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