Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A2B9A9C80 for ; Sun, 15 Apr 2012 15:09:40 +0000 (UTC) Received: (qmail 56639 invoked by uid 500); 15 Apr 2012 15:09:39 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 56599 invoked by uid 500); 15 Apr 2012 15:09:39 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 56591 invoked by uid 99); 15 Apr 2012 15:09:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Apr 2012 15:09:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_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; Sun, 15 Apr 2012 15:09:38 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4DF0E36CE93 for ; Sun, 15 Apr 2012 15:09:18 +0000 (UTC) Date: Sun, 15 Apr 2012 15:09:18 +0000 (UTC) From: "Claus Ibsen (Resolved) (JIRA)" To: issues@camel.apache.org Message-ID: <762803646.26641.1334502558366.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <883001966.25554.1334411600957.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Resolved] (CAMEL-5172) TypeConverter - Tighten up API to rethrow failed exception during type conversion, and introduce new API for try to convert MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAMEL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Claus Ibsen resolved CAMEL-5172. -------------------------------- Resolution: Fixed The Type Converter API has been adjust accordingly. Now the default behavior by the Camel type converter system, is to fail fast, and propagate exceptions back the the caller by default. You can use the new tryConvertTo to use the old behavior. > TypeConverter - Tighten up API to rethrow failed exception during type conversion, and introduce new API for try to convert > --------------------------------------------------------------------------------------------------------------------------- > > Key: CAMEL-5172 > URL: https://issues.apache.org/jira/browse/CAMEL-5172 > Project: Camel > Issue Type: Improvement > Components: camel-core > Reporter: Claus Ibsen > Assignee: Claus Ibsen > Fix For: 2.10.0 > > > The org.apache.camel.TypeConverter API would not propagate exceptions that would occur during type conversion back to the caller. But instead return null. > We should tighten this up and introduce a new API for trying to convert, so what we would have is > - convertTo = converts, and throws exception if failure during conversion, can return null, if no value to convert, or no type converter exists to do this > - mandatoryConvertTo = convertTo + will throw exception if no value, eg it never returns null > - *new* tryConvertTo = convertTo but will catch exceptions and return null (like the old behavior) > This introduces an API change in TypeConverter. But it is more intuitive. There is some internal logic that needs to be adjust a bit due they rely on the old behavior. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira