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

Let okStatusCodeRange support multiple ranges

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.20.1
    • 2.21.0
    • camel-http, camel-http4
    • None
    • Patch Available
    • Novice
    • Patch

    Description

      When working with rest api's, some http status codes such as 404 Not Found are not necessarily errors. It would be nice to be able to specify multiple ranges and individual codes such as okStatusCodeRange=200-204,404.

      This would allow us to handle 404 in the main route logic while still throwing an exception for other status codes. While we can use throwExceptionOnFailure=false we then have to throw exceptions ourselves for most status codes.

      As far as I can tell, this requires a simple modification in HttpHelper::isStatusCodeOk.
      I will give it a shot.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            niels@harremoes.dk Niels Ull Harremoes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

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