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

David J. M. Karlsen edited comment on CAMEL-4576 at 10/25/11 4:43 PM:
----------------------------------------------------------------------

Yes - I want to do a conditional check in a step - and given that it evaluates 
throw an arbitrary exception with arbitrary parameters (using for instance the 
bean binding stuff for the params).

Something like
{noformat}
<camel:when>
        <camel:setBody>{in.body.args[0].myGet}</camel:setBody>
        <camel:simple>bean:mySpringbean?method=isOffline( ${in.header.name} 
)</camel:simple>
        <camel:throwException expression="com.company.SomeException( 
${in.header.someHeader} is offline) ">
</camel:when>
{noformat}

really looking forward to the 2.9.x beanBinding stuff - it looks very powerful.
                
      was (Author: davidkarl...@gmail.com):
    Yes - I want to do a conditional check in a step - and given that it 
evaluates throw an arbitrary exception with arbitrary parameters (using for 
instance the bean binding stuff for the params).
                  
> 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-core
>    Affects Versions: 2.8.1
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: exception, throwException, xml
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to