Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 72641 invoked from network); 4 Dec 2008 13:29:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Dec 2008 13:29:05 -0000 Received: (qmail 42211 invoked by uid 500); 4 Dec 2008 13:29:17 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 42195 invoked by uid 500); 4 Dec 2008 13:29:17 -0000 Mailing-List: contact camel-dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-dev@activemq.apache.org Delivered-To: mailing list camel-dev@activemq.apache.org Received: (qmail 42184 invoked by uid 99); 4 Dec 2008 13:29:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 05:29:17 -0800 X-ASF-Spam-Status: No, hits=-1999.8 required=10.0 tests=ALL_TRUSTED,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Dec 2008 13:27:47 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 66236234C2CC for ; Thu, 4 Dec 2008 05:28:05 -0800 (PST) Message-ID: <1758967275.1228397285403.JavaMail.jira@brutus> Date: Thu, 4 Dec 2008 05:28:05 -0800 (PST) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-1144) Exceptions thrown from converters are not correctly handled In-Reply-To: <886249735.1228387565372.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=47863#action_47863 ] Claus Ibsen commented on CAMEL-1144: ------------------------------------ D:\project\camel\camel-core>svn commit --message "CAMEL-1144: DefaultExceptionPolicyStrategy now tests caused by exceptions (using bottom to top exception hieracy iterator)" Sending camel-core\src\main\java\org\apache\camel\processor\exceptionpolicy\DefaultExceptionPolicyStrategy.java Adding camel-core\src\test\java\org\apache\camel\processor\onexception\OnExceptionWrappedExceptionTest.java Transmitting file data .. Committed revision 723314. > Exceptions thrown from converters are not correctly handled > ----------------------------------------------------------- > > Key: CAMEL-1144 > URL: https://issues.apache.org/activemq/browse/CAMEL-1144 > Project: Apache Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 1.5.0 > Reporter: Martin Gilday > Assignee: Claus Ibsen > Priority: Critical > Fix For: 1.5.1, 2.0.0 > > > Related nabble: http://www.nabble.com/Handling-converter-failure-td20830148s22882.html > When an exception is thrown from a @Converter it is not correctly handled by onException. The handler is receiving a RuntimeCamelException and not checking the cause when determining the best handler. > {code} > /////Converter > @Converter > public static LocalDateTime toLocalDateTime(final Object localDateTime) > { > System.out.println("Converting to local date time"); > throw new IllegalArgumentException("Bad data"); > } > /////Routes > Routes routes = new RouteBuilder() { > @Override > public void configure() throws Exception { > onException(IllegalArgumentException.class).handled(true).to("mock:exception"); > from("direct:test").convertBodyTo(LocalDateTime.class).to("mock:end"); > } > }; > /////Test > MockEndpoint endpoint = (MockEndpoint) > camelContext.getEndpoint("mock:end"); > endpoint.expectedMessageCount(0); > MockEndpoint endpoint2 = (MockEndpoint) > camelContext.getEndpoint("mock:exception"); > endpoint2.expectedMessageCount(1); > camelContext.createProducerTemplate().sendBody("direct:test", "test"); > endpoint.assertIsSatisfied(); > endpoint2.assertIsSatisfied(); > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.