camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Which exception on a bad conversion in a TypeConverter?
Date Fri, 30 Aug 2013 13:55:41 GMT

You can throw any kind of exception you want. For example
NumberFormatException, IllegalArgumentException

Though there is a TypeConversionException which is maybe what you are
looking for.
But there is no rule that it must be TypeConversionException exception
thrown. You can throw what you want.

On Fri, Aug 30, 2013 at 2:24 PM, Cristiano Costantini
<> wrote:
> Hi all,
> Which Exception should I use when I can't convert something in a
> TypeConverter?
> I was throwing a  org.apache.camel.NoTypeConversionAvailableException,
> but this is used when no type converter exists.
> Is there an appropriate exception recommended to be used?
> thank you!
> Cristiano

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message