Class InvalidResponseException

  • All Implemented Interfaces:
    Serializable

    public final class InvalidResponseException
    extends VaultConnectorException
    Exception thrown when response from vault returned with erroneous status code or payload could not be parsed to entity class.
    Since:
    0.1
    Author:
    Stefan Kalscheuer
    See Also:
    Serialized Form
    • Constructor Detail

      • InvalidResponseException

        public InvalidResponseException()
        Constructs a new empty exception.
      • InvalidResponseException

        public InvalidResponseException​(String message)
        Constructs a new exception with the specified detail message.
        Parameters:
        message - The detail message
      • InvalidResponseException

        public InvalidResponseException​(Throwable cause)
        Constructs a new exception with the specified cause.
        Parameters:
        cause - The cause
      • InvalidResponseException

        public InvalidResponseException​(String message,
                                        Throwable cause)
        Constructs a new exception with the specified detail message and cause.
        Parameters:
        message - The detail message
        cause - The cause
      • InvalidResponseException

        public InvalidResponseException​(String message,
                                        Integer statusCode)
        Constructs a new exception with the specified detail message and status code.

        The HTTP status code can be retrieved by getStatusCode() later.

        Parameters:
        message - The detail message
        statusCode - Status code of the HTTP response
        Since:
        0.6.2
      • InvalidResponseException

        public InvalidResponseException​(String message,
                                        Integer statusCode,
                                        Throwable cause)
        Constructs a new exception with the specified detail message, cause and status code.

        The HTTP status code can be retrieved by getStatusCode() later.

        Parameters:
        message - The detail message
        statusCode - Status code of the HTTP response
        cause - The cause
        Since:
        0.6.2
      • InvalidResponseException

        public InvalidResponseException​(String message,
                                        Integer statusCode,
                                        String response)
        Constructs a new exception with the specified detail message, cause and status code.

        The HTTP status code can be retrieved by getStatusCode() later.

        Parameters:
        message - The detail message
        statusCode - Status code of the HTTP response
        response - HTTP response string
        Since:
        0.6.2
      • InvalidResponseException

        public InvalidResponseException​(String message,
                                        Integer statusCode,
                                        String response,
                                        Throwable cause)
        Constructs a new exception with the specified detail message, cause and status code.

        The HTTP status code can be retrieved by getStatusCode() later.

        Parameters:
        message - The detail message
        statusCode - Status code of the HTTP response
        response - HTTP response string
        cause - The cause
        Since:
        0.6.2
    • Method Detail

      • withStatusCode

        @Deprecated
        public InvalidResponseException withStatusCode​(Integer statusCode)
        Deprecated.
        as of 0.6.2, use constructor with status code argument instead
        Specify the HTTP status code. Can be retrieved by getStatusCode() later.
        Parameters:
        statusCode - The status code
        Returns:
        self
      • withResponse

        @Deprecated
        public InvalidResponseException withResponse​(String response)
        Deprecated.
        use constructor with response argument instead
        Specify the response string. Can be retrieved by getResponse() later.
        Parameters:
        response - Response text
        Returns:
        self
      • getStatusCode

        public Integer getStatusCode()
        Retrieve the HTTP status code.
        Returns:
        The status code or null if none specified.
      • getResponse

        public String getResponse()
        Retrieve the response text.
        Returns:
        The response text or null if none specified.