[jira] Created: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped

JIRA jira@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.

Reply | Threaded
Open this post in threaded view
|

[jira] Work started: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped

JIRA jira@apache.org

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

Work on CAMEL-899 started by 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 | Threaded
Open this post in threaded view
|

[jira] Assigned: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ 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 | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-899?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45696#action_45696 ]

Claus Ibsen commented on CAMEL-899:
-----------------------------------

camel-core 'DONE*

> 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 | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-899) Check all code - RuntimeCamelException should be properly wrapped

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

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

Claus Ibsen resolved CAMEL-899.
-------------------------------

    Fix Version/s: 1.5.0
       Resolution: Fixed

> 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
>             Fix For: 1.5.0
>
>
> 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.