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

Let okStatusCodeRange support multiple ranges

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.20.1
    • Fix Version/s: 2.21.0
    • Component/s: camel-http, camel-http4
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Novice
    • Flags:
      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

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              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