I am sorry I forgot to post the code of the method that throws exceptions.

public MyClass{
       public static boolean myMethodThatThrowsException(Message in) throws
IllegalArgumentException{
           String address = in.getHeader("address", String.class);
           return isValidAddress(address);
       }

       private static isValidAddress(String address) throws
IllegalArgumentException{
           if (address.startWith("I'm valid"))
              return true;              
           if (address.startWith("I'm not valid"))
              return false;
           throw new IllegalArgumentException("Unknown");
       }
}

Thank you!
-- 
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-handle-exceptions-thrown-by-camel-choice-tp3245484p3245506.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to