Class ClientException

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    TestingIOException, TestingSetupException, TestingValidationException

    public class ClientException
    extends Exception
    An exception thrown when something went wrong with using the sling testing clients. This class will be turned into an abstract class eventually, so do use the specialized sub-classes instead:
    • TestingIOException to indicate network and IO problems
    • TestingValidationException to indicate a mismatch between expectation and result
    • TestingSetupException to indicate problems in the test setup (incorrect parameters etc)
    See Also:
    Serialized Form
    • Constructor Detail

      • ClientException

        @Deprecated
        public ClientException​(String message)
        Deprecated.
        use a constructor of one of the subclasses
        Parameters:
        message - message
      • ClientException

        @Deprecated
        public ClientException​(String message,
                               Throwable throwable)
        Deprecated.
        use a constructor of one of the subclasses
        Parameters:
        message - message
        throwable - a throwable
      • ClientException

        @Deprecated
        public ClientException​(String message,
                               int httpStatusCode)
        Deprecated.
        use a constructor of one of the subclasses
        Parameters:
        message - message
        httpStatusCode - statuscode
      • ClientException

        @Deprecated
        public ClientException​(String message,
                               int httpStatusCode,
                               Throwable throwable)
        Deprecated.
        use a constructor of one of the subclasses
        Parameters:
        message - message
        httpStatusCode - statuscode
        throwable - throwable
      • ClientException

        @Deprecated
        public ClientException​(String message,
                               Throwable throwable,
                               org.apache.http.client.methods.HttpUriRequest request,
                               SlingHttpResponse response)
        Deprecated.
        use a constructor of one of the subclasses
        Parameters:
        message - message
        throwable - throwable
        request - request
        response - response
    • Method Detail

      • getRequest

        public org.apache.http.client.methods.HttpUriRequest getRequest()
        Returns:
        The request associated with this exception or {{null}}
      • setRequest

        public void setRequest​(org.apache.http.client.methods.HttpUriRequest request)
        Set the request associated with this exception
        Parameters:
        request - request
      • getResponse

        public SlingHttpResponse getResponse()
        Returns:
        The response associated with this exception or {{null}}
      • setResponse

        public void setResponse​(SlingHttpResponse response)
        Set the response associated with this exception or {{null}}
        Parameters:
        response - response
      • getHttpStatusCode

        public int getHttpStatusCode()
        Returns:
        the httpStatusCode