Yes i tried , but i fiend out a solution 

This dosen“t work:

         exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 522);
         exchange.getOut().setFault(true);

Becouse there is already a exception on the exchange.

But here is the trick, remove the exception that already is on the exchange.

  exchange.removeProperty(Exchange.EXCEPTION_CAUGHT);
  exchange.getOut().setHeader(Exchange.HTTP_RESPONSE_CODE, 522);
  exchange.getOut().setFault(true);

now i get a 522 back in the reponse and not a 500 


Thanks out there 



--
View this message in context: 
http://camel.465427.n5.nabble.com/I-cant-throw-the-correct-HTTP-status-codes-from-camel-tp5758282p5758335.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to