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

Allow ClientRequestFilter and ClientResponseFilter to throw custom exceptions.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Trivial Trivial
    • 3.1.1.Final, 3.0.21.Final
    • None
    • jaxrs
    • None

      I have created a client for an API. This API returns an error code in the body, along with the HTTP status code. In the ClientInvocation class, the method handleErrorStatus maps the HTTP status to its corresponding exception, which is fine, but I would like to throw a custom exception from the client and have the API error code in that exception. If I try to do that, and since all filters are within a try-catch (where one catch is Throwable), the exception thrown from the filter is wrapped in a ResponseProcessingException, or ProcessingException, depending on which filter type of filter throws the exception. I think that allowing a filter to handle the HTTP request and response, if one needs, offers greater flexibility, without breaking the current default error handling.

            rhn-support-asoldano Alessio Soldano
            drievs Niall Drievers (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: