Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-13899

Allow Custom HTTP_RESPONSE_CODE on Fault

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • camel-http-common
    • None
    • Novice

    Description

      Currently when you set a route as Fault Camel disregards the HTTP_RESPONSE_CODE reader, not allowing user to set custom STATUS CODE. 

      To allow more control of the faults the code could check if the user set the header. If the header is there we use it. otherwise set the default 500.

       

      Example, in this case I would expect the response to be 401, but it was 500 instead:

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            ddiehl Daniel Diehl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 4h
                4h
                Remaining:
                Remaining Estimate - 4h
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified