camel-users mailing list archives

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

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
<cristiano.costantini@gmail.com> 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.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message