It would be nice to keep this exception class around for endpoints to reject invalid messages.
There was an old ticket about components advertising their supported payload types. This exception class could belong within that context. Regards, Raúl. On 13 Jan 2013 21:13, "Babak Vahdat" <babak.vah...@swissonline.ch> wrote: > Hi > > I think the idea is to reuse the Exceptions declared by the TypeConverter > API like TypeConversionException, NoTypeConversionAvailableException. And > while reading the InvalidPayloadException JavaDoc itself it's purpose says > exactly what we've got already through the TypeConverter API meaning this > exception is obsolete. > > As an example we've got the following method signature on > org.apache.camel.Message: > > <T> T getMandatoryBody(Class<T> type) throws InvalidPayloadException; > > Which I think in Camel 3.0 will be changed to something like > > <T> T getMandatoryBody(Class<T> type) throws TypeConversionException, > NoTypeConversionAvailableException; > > Also IMHO the latter exceptions have a really better naming explaining the > *exact* root cause of the problem e.g. type conversion failed or no type > conversion was available at all, the former however is a bit obscure as > there's nothing clear *why* the payload was/is invalid. > > Babak > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/org-apache-camel-InvalidPayloadException-tp5725502p5725511.html > Sent from the Camel Development mailing list archive at Nabble.com. >