Class RequestException

  • All Implemented Interfaces:
    Serializable

    public class RequestException
    extends Exception
    An error that occurred during a RequestRouter request.
    Author:
    Robert Fromont robert@fromont.net.nz
    See Also:
    Serialized Form
    • Constructor Detail

      • RequestException

        public RequestException​(int httpStatus,
                                String message,
                                String method,
                                URI uri,
                                Throwable cause)
        Constructor.
        Parameters:
        httpStatus - The HTTP status code to return.
        message - The error message.
        method - The request method.
        uri - The request URI.
        cause - The root cause of the exception.
      • RequestException

        public RequestException​(int httpStatus,
                                String method,
                                URI uri,
                                Throwable cause)
        Constructor.
        Parameters:
        httpStatus - The HTTP status code to return.
        method - The request method.
        uri - The request URI.
        cause - The root cause of the exception.
      • RequestException

        public RequestException​(int httpStatus,
                                String message,
                                String method,
                                URI uri)
        Constructor.
        Parameters:
        httpStatus - The HTTP status code to return.
        message - The error message.
        method - The request method.
        uri - The request URI.
    • Method Detail

      • getMethod

        public String getMethod()
        Getter for method: The request method.
        Returns:
        The request method.
      • getUri

        public URI getUri()
        Getter for uri: The request URI.
        Returns:
        The request URI.
      • getHttpStatus

        public int getHttpStatus()
        Getter for httpStatus: The HTTP status code to return.
        Returns:
        The HTTP status code to return.
      • setHttpStatus

        public RequestException setHttpStatus​(int newHttpStatus)
        Setter for httpStatus: The HTTP status code to return.
        Parameters:
        newHttpStatus - The HTTP status code to return.
      • toString

        public String toString()
        String representation of the object.
        Overrides:
        toString in class Throwable
        Returns:
        String representation of the object.