camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yli <>
Subject Re: how to handle exceptions thrown by <camel:choice>
Date Mon, 01 Nov 2010 18:31:31 GMT

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

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

       private static isValidAddress(String address) throws
           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:
Sent from the Camel - Users mailing list archive at

View raw message