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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.2-beta-1
    • 2.0.GA
    • None
    • None

      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.

            patriot1burke@gmail.com Bill Burke (Inactive)
            vpartington_jira Vincent Partington (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: