Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-435

ClientResponseFailure not thrown by the RESTEasy client framework when the method signature returns void

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.GA
    • Fix Version/s: 2.2-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      When the the signature of a method says the method returns void, any HTTP errors are ignored. The documentation at <http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html/RESTEasy_Client_Framework.html#Client_error_handling> says that any result code >399 results in a ClientResponseFailure. That is indeed the case for methods that return a value, but not for methods that return void.

      As a workaround I made all my REST calls return a value, even though it might be a dummy String.

      My guess is that this is caused due to the fact that the anonymous extractor returned by DefaultEntityExtractorFactory.createVoidExtractor does not invoke response.checkFailureStatus() like the BodyEntityExtractor does.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bill.burke Bill Burke
                Reporter:
                vpartington Vincent Partington
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: