[ 
https://issues.apache.org/activemq/browse/CAMEL-899?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen reassigned CAMEL-899:
---------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: 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.

Reply via email to