Class InvalidParameterException

All Implemented Interfaces:
Serializable

public class InvalidParameterException extends IllegalStateException
Extend IllegalStateException to identify the cause as an invalid parameter.

Implementation note: This class extends IllegalStateException since that is the class that the Servlet 6.1 onwards Javadocs define is thrown by the various ServletRequest.getParameterXXX() methods.

See Also:
  • Constructor Details

    • InvalidParameterException

      public InvalidParameterException(String message)
      Construct a new exception with the given message.
      Parameters:
      message - The message to use for the exception
    • InvalidParameterException

      public InvalidParameterException(String message, int errorCode)
      Construct a new exception with the given message and error code.
      Parameters:
      message - The message to use for the exception
      errorCode - The HTTP status code to use when reporting this error. Expected to be >= 400.
    • InvalidParameterException

      public InvalidParameterException(String message, Throwable cause)
      Construct a new exception with the given message and cause.
      Parameters:
      message - The message to use for the exception
      cause - The exception to use as the cause of this exception
    • InvalidParameterException

      public InvalidParameterException(Throwable cause)
      Construct a new exception with the given cause. The message for this exception will be generated by calling cause.toString().
      Parameters:
      cause - The exception to use as the cause of this exception
    • InvalidParameterException

      public InvalidParameterException(Throwable cause, int errorCode)
      Construct a new exception with the given cause and error code. The message for this exception will be generated by calling cause.toString().
      Parameters:
      cause - The exception to use as the cause of this exception
      errorCode - The HTTP status code to use when reporting this error. Expected to be >= 400.
  • Method Details

    • getErrorCode

      public int getErrorCode()