org.qi4j.library.rest.client.api

## Class ErrorHandler

- java.lang.Object
- - org.qi4j.library.rest.client.api.ErrorHandler

- All Implemented Interfaces:
    ResponseHandler

      public class ErrorHandler
      extends Object
      implements ResponseHandler

  Implements a chained list of specification->handler. Add the most specific handlers first, and the most generic last.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Specification<org.restlet.Response>` | `AUTHENTICATION_REQUIRED`
    `static Specification<org.restlet.Response>` | `RECOVERABLE_ERROR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ErrorHandler()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `HandlerCommand` | `handleResponse(org.restlet.Response response, ContextResourceClient client)`
    `ErrorHandler` | `onError(ResponseHandler handler)`
    `ErrorHandler` | `onError(Specification<org.restlet.Response> responseSpecification, ResponseHandler handler)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### AUTHENTICATION_REQUIRED

          public static Specification<org.restlet.Response> AUTHENTICATION_REQUIRED

    - #### RECOVERABLE_ERROR

          public static Specification<org.restlet.Response> RECOVERABLE_ERROR

  - ### Constructor Detail

    - #### ErrorHandler

          public ErrorHandler()

  - ### Method Detail

    - #### onError

          public ErrorHandler onError(Specification<org.restlet.Response> responseSpecification,
                             ResponseHandler handler)

    - #### onError

          public ErrorHandler onError(ResponseHandler handler)

    - #### handleResponse

          public HandlerCommand handleResponse(org.restlet.Response response,
                                      ContextResourceClient client)

      Specified by:
        `handleResponse` in interface `ResponseHandler`