Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18169

setException as for Camel DSL

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Trivial
    • Resolution: Won't Fix
    • None
    • None
    • came-core
    • None
    • Unknown

    Description

      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();

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            rambichler Michael Rambichler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: