[jira] Created: (CAMEL-1120) Getting exception message using builder

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

[jira] Created: (CAMEL-1120) Getting exception message using builder

JIRA jira@apache.org
Getting exception message using builder
---------------------------------------

                 Key: CAMEL-1120
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1120
             Project: Apache Camel
          Issue Type: New Feature
          Components: camel-core
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
            Priority: Minor
             Fix For: 2.0.0


The exception clause below
{code}
                onException(MyFunctionalException.class)
                        .handled(true)
                        .transform(constant("Sorry"));
{code}

Instead of returning the constant Sorry we want to return the exception message, instead of using a processor, bean etc. we want some value builder in BuilderSupport so you can do it as:
{code}
                onException(MyFunctionalException.class)
                        .handled(true)
                        .transform(exceptionMessage());
{code}

And also add variables to the exception message in the simple language so you can do something like this:
{code}
                onException(MyFunctionalException.class)
                        .handled(true)
                        .transform().simple("Error reported ${exception.message} - can not process this message.");
{code}

Then the caller will receive the response we have created there instead of the MyFunctionalException

--
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-1120) Getting exception message using builder

JIRA jira@apache.org

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

Claus Ibsen resolved CAMEL-1120.
--------------------------------

    Resolution: Fixed

Fixed in 2.0 and updated wiki at exception clause and simple language.

> Getting exception message using builder
> ---------------------------------------
>
>                 Key: CAMEL-1120
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1120
>             Project: Apache Camel
>          Issue Type: New Feature
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> The exception clause below
> {code}
>                 onException(MyFunctionalException.class)
>                         .handled(true)
>                         .transform(constant("Sorry"));
> {code}
> Instead of returning the constant Sorry we want to return the exception message, instead of using a processor, bean etc. we want some value builder in BuilderSupport so you can do it as:
> {code}
>                 onException(MyFunctionalException.class)
>                         .handled(true)
>                         .transform(exceptionMessage());
> {code}
> And also add variables to the exception message in the simple language so you can do something like this:
> {code}
>                 onException(MyFunctionalException.class)
>                         .handled(true)
>                         .transform().simple("Error reported ${exception.message} - can not process this message.");
> {code}
> Then the caller will receive the response we have created there instead of the MyFunctionalException

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.