You can use the option skipBindingOnErrorCode to control if the binding should happen or not.
On Wed, Jan 21, 2015 at 1:24 PM, James Green <james.mk.gr...@gmail.com> wrote: > Just re-reading the "Binding POJOs" bit, will this also take effect for the > out part of an exception? > > onException(MyException.class).handled(true).setHeader(Exchange.HTTP_RESPONSE_CODE, > constant(400)).process(myExceptionHandler).end() > > Should I expect the Message provided by myExceptionHandler to be formatted > to JSON/XML according to the HTTP client's choice? > > > On 21 January 2015 at 11:51, James Green <james.mk.gr...@gmail.com> wrote: > >> If Camel can accept and map both JSON and XML inputs to POJOs, is there a >> way of reversing this for onException handling purposes? >> >> The only example of onException sets the content-type and formatted >> content on the Exchange. But I may not know this. >> >> Within Spring MVC there is @ResponseStatus allowing us to specify the HTTP >> response code for a particular Exception without needing to care about the >> response content type, which is the bit I'm not spotting an equivalent for. >> >> Am I missing something or is this a bit of a hole? >> >> Thanks, >> >> James >> >> -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/