On Fri, Feb 26, 2010 at 6:31 PM, jfaath <[email protected]> wrote: > > By consulting the documentation, I came up with this code to handle an error > for messages sent to a jetty http endpoint: > > onException(SchemaValidationException.class) > .handled(true) > .transform() > .simple("The format of the incoming message does not conform to the > specification."); > > Everything works fine, except using "handled(true)" causes a 200 OK response > to be sent back to the client. When I use "handled(false)" a 500 response > is returned, but I lose my custom error message. > > Is there any way to return a 500 error but keep the nice error message? >
I am sure it returns your nice message with HTTP error code 500. I wonder if you webbrowser or what you use to view the result may suppress the nice message and display its own message. The browser may have an setting to disable this. > -JF > > -- > View this message in context: > http://old.nabble.com/Default-error-handler%2C-changing-HTTP-response-code-tp27721146p27721146.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
