Michael Rambichler created CAMEL-18169:
------------------------------------------

             Summary: setException as for Camel DSL
                 Key: CAMEL-18169
                 URL: https://issues.apache.org/jira/browse/CAMEL-18169
             Project: Camel
          Issue Type: New Feature
          Components: came-core
            Reporter: Michael Rambichler


For convinience I would like to have camel dsl extended with following method:

*.setException(..)*

 

Then the following example would be one liner.

 

*Example:*

.doTry()
    // try something
.endDoTry()
doCatch(Exception.class)
   // Set the exception after our compensation logic is performed in order for 
the route error handler to kick in.
                    .process(exchange -> {
                        Exception exception = 
exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
                        if (exception != null) {
                            exchange.setException(exception);
                        }
                    })
.end();

 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to