Interface ResponseExceptionMapper<T extends java.lang.Throwable>

  • public interface ResponseExceptionMapper<T extends java.lang.Throwable>
    Converts an JAX-RS Response object into an Exception.
    • Field Summary

      Modifier and Type Field Description
      static int DEFAULT_PRIORITY  
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default int getPriority​()
      The priority of this mapper.
      default boolean handles​(int status,<java.lang.String,java.lang.Object> headers)
      Whether or not this mapper will be used for the given response.
      T toThrowable​( response)
      Converts a given Response into a Throwable.
    • Method Detail

      • toThrowable

        T toThrowable​( response)
        Converts a given Response into a Throwable. The runtime will throw this if it is non-null AND if it is possible to throw given the client method's signature. If this method reads the response body as a stream it must ensure that it resets the stream.
        response - the JAX-RS response processed from the underlying client
        A throwable, if this mapper could convert the response.
      • handles

        default boolean handles​(int status,
                      <java.lang.String,java.lang.Object> headers)
        Whether or not this mapper will be used for the given response. By default, any response code of 400 or higher will be handled. Individual mappers may override this method if they want to more narrowly focus on certain response codes or headers.
        status - the response status code indicating the HTTP response
        headers - the headers from the HTTP response
        whether or not this mapper can convert the Response to a Throwable
      • getPriority

        default int getPriority​()
        The priority of this mapper. By default, it will use the Priority annotation's value as the priority. If no annotation is present, it uses a default priority of Priorities.USER.
        the priority of this mapper