Return-Path: Delivered-To: apmail-activemq-camel-dev-archive@locus.apache.org Received: (qmail 45491 invoked from network); 14 Sep 2008 11:39:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Sep 2008 11:39:43 -0000 Received: (qmail 12670 invoked by uid 500); 14 Sep 2008 11:39:40 -0000 Delivered-To: apmail-activemq-camel-dev-archive@activemq.apache.org Received: (qmail 12652 invoked by uid 500); 14 Sep 2008 11:39:39 -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 12641 invoked by uid 99); 14 Sep 2008 11:39:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Sep 2008 04:39:39 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED 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; Sun, 14 Sep 2008 11:38:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 925A8234C1C5 for ; Sun, 14 Sep 2008 04:38:52 -0700 (PDT) Message-ID: <1553122834.1221392332582.JavaMail.jira@brutus> Date: Sun, 14 Sep 2008 04:38:52 -0700 (PDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Created: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Check all code - RuntimeCamelException should be properly wrapped ----------------------------------------------------------------- Key: CAMEL-899 URL: https://issues.apache.org/activemq/browse/CAMEL-899 Project: Apache Camel Issue Type: Task Affects Versions: 1.4.0 Reporter: Claus Ibsen Priority: Minor Code such as: {code} catch (Exception e) { throw new RuntimeCamelException(e); } {code} should use a wrapper check if the exception is already a RuntimeCamelException. If not then we get nested pointless wrappings. In fact the TraceInterceptor in camel-spring had this and depending on how long your route was you would get N deep wrappings. The following code should be in camel-core somewhere: {code} /** * Wraps the caused exception in a RuntimeCamelException if its not already such an exception */ private static RuntimeCamelException wrapRuntimeCamelException(Throwable e) { // TODO: Move to camel-core if (e instanceof RuntimeCamelException) { // dont double wrap if already a RuntimeCamelException return (RuntimeCamelException) e; } else { return new RuntimeCamelException(e); } } {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.