You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2015/07/10 14:33:05 UTC

[jira] [Commented] (CAMEL-4576) Make exception throwing as flexible in XML as in Java DSL

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

Claus Ibsen commented on CAMEL-4576:
------------------------------------

You can now do (also possible in java dsl)
{code:xml}
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="direct:start"/>
            <to uri="mock:start"/>
            <throwException exceptionType="java.lang.IllegalArgumentException" message="Darn ${body} is invalid"/>
            <to uri="mock:result"/>
        </route>
    </camelContext>
{code}

> Make exception throwing as flexible in XML as in Java DSL
> ---------------------------------------------------------
>
>                 Key: CAMEL-4576
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4576
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-blueprint, camel-core, camel-spring
>    Affects Versions: 2.8.1
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: exception, throwException, xml
>             Fix For: 2.16
>
>
> When throwing exceptions there are more options in the java DSL (one has full control) than in the XML where you can only reference an exception instance.
> It would be useful to be able to construct the exception and throw it, so that one could add messages to it - preferably like:
> {noformat}
> throwException class="someEx" message="someProblem ${body} ${in.header.someHeader}
> {noformat}
> Reference: http://camel.apache.org/exception-clause.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)